Tutorials Forums
     Tutorials Videos
        Sign Up Now For FREE
Welcome, Guest
Username Password: Remember me

How to deal with different browsers and positionin
(1 viewing) (1) Guest
HTML HELP, HTML TUTORIALS, HTML PROGRAMMING, HTML CODE, HTML DESIGN

Hypertext Markup Language (HTML) is the authoring software language used for building web pages. It is a subset of Standard Generalized Markup Language (SGML). In HTML, a block of text is often surrounded by tags that indicate how a browser should display it. There’s much more to HTML than that, of course, as the articles in this section detail.
  • Page:
  • 1

TOPIC: How to deal with different browsers and positionin

How to deal with different browsers and positionin 08 Dec 2009 07:41 #51

This is a sure-fire way you can beat those pesky positioning and header size differences between IE, FireFox and Safari.

Instructions: Instead of having the regular single stylesheet for your page in the section, we're going to have the Web page load a different stylesheet depending on what browser the user is using. It doesn't exactly validate through W3, (which sucks because I really frown upon non-valid xhtml), but its one of the best ways of dealing with the differences that I have come across yet. Enjoy :)

 
 
<html>
<body>
 
<head>
 
<link rel="stylesheet" type="text/css" href="FireFoxSafari.css"/>
/* We loaded the one above first because Safari doesn't recognize the tags
we are about to use. */

 
<!--[if gte IE 5.5000]> // IF greater than or equal to IE 5.5, load this css
<link rel="stylesheet" type="text/css" href="FireFoxSafariStyleSheet.css"/>
 
<!--[if !IE]> //IF not IE, load this css
<link rel="stylesheet" type="text/css" href="IEStyleSheet.css"/>
<![endif]-->
 
</head>
 
</body>
</html>
 
  • mnjon
  • OFFLINE
  • CE Staff
  • Posts: 78
  • Karma: 40
CodersEngine
  • Page:
  • 1
Time to create page: 0.30 seconds