Web Development Blog

Twitter

All these CSS are used in a conditional CSS file for IE 6 to ensure CSS validity as some of the properties used here are proprietary to the IE 6 browser.

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie6.css" />
<![endif]-->

Setting an opacity

.transparency {
   filter: alpha(opacity=50);
}

Change the link to a hand cursor

a.link {
   cursor: pointer;
}

Get rid of double margin bug by adding display:inline to a block level element

#sidebar {
   float: left;
   margin-left: 20px;
   width: 300px;
   display: inline;
}

Ensure proper positioning of list items

ul li {
   display: inline-block;
}

Hide extra spaces and padding

#header {
   height: 10px;
   overflow: hidden;
}

Bring a layer on top of other layers

#close {
   position: absolute;
   z-index: 50;
}

Resolve float issue in IE6 by triggering hasLayout property

#content {
   zoom: 1;
}

PNG transparency in IE6 (uses IEPNGFix code)

#background {
   behavior: url(iepngfix.htc);
}

HTML

  <input type="submit" id="submit" value="Search" />

CSS

#submit {
  cursor: pointer;
}

In order to display a download dialog for pdf file rather than opening it in the browser, we can put the following snippet of code in a php file and name the file download.php.

The path to the pdf file is specified in $filename variable. You can also pass filename as a parameter in the URL but you will need to check for Cross Site Scripting (XSS) and various script injection attempts if you decide to get the filename from the URL paramater.

  $filename = '/path/to/your/file/download.pdf';
  header("Pragma: public");
  header("Expires: 0");
  header("Pragma: no-cache");
  header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
  header("Content-Type: application/force-download");
  header("Content-Type: application/octet-stream");
  header("Content-Type: application/download");
  header('Content-disposition: attachment; filename=' . basename($filename));
  header("Content-Type: application/pdf");
  header("Content-Transfer-Encoding: binary");
  header('Content-Length: ' . filesize($filename));
  @readfile($filename);
  exit(0);

In header.php file of my WordPress theme, I have the following code to display a different header image for different pages.

<?php
  if (is_page('about')) {
      $image = 'image_about.jpg';
  } else if (is_page('projects')) {
      $image = 'image_projects.jpg';
  } else if (is_page('services')) {
      $image = 'image_services.jpg';
  } else if (is_page('contact')) {
      $image = 'image_contact.jpg';
  } else {
      $image = 'image_default.jpg';
  }
?>
<div id="header">
<img src="<?php echo bloginfo('template_url'); ?>
/images/<?php echo $image;?>"
alt="<?php bloginfo('name'); ?>" />
</div>

14 Jun, 2009

Reasons For Using Internet Explorer

Posted in: WWW

Reasons For Using Internet Explorer

Interests

Web development, Web design, Open source technologies, Portal development, APIs, Web services, Social media applications, Search engine optimisation, Mobile application development, iPhone Apps, Web 2.0, Web 3.0, Latest Internet technologies

Sponsors

Advertise here