9 Replies - 1308 Views - Last Post: 16 July 2009 - 11:52 AM

#1 Winstinology  Icon User is offline

  • I'm pretty good with a laser mouse..
  • member icon

Reputation: 7
  • View blog
  • Posts: 958
  • Joined: 08-May 08

How to deal with different browsers and positioning differences.

Posted 11 June 2008 - 12:36 PM

Description: Instead of having the regular single stylesheet for your page in the <head> 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 :)This is a sure-fire way you can beat those pesky positioning and header size differences between IE, FireFox and Safari.
<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>


Is This A Good Question/Topic? 0
  • +

Replies To: How to deal with different browsers and positioning differences.

#2 spearfish  Icon User is offline

  • Monkey in Training
  • member icon

Reputation: 10
  • View blog
  • Posts: 746
  • Joined: 10-March 08

Re: How to deal with different browsers and positioning differences.

Posted 12 June 2008 - 10:31 AM

Shouldn't there be an end if on line 12?
Was This Post Helpful? 0
  • +
  • -

#3 Winstinology  Icon User is offline

  • I'm pretty good with a laser mouse..
  • member icon

Reputation: 7
  • View blog
  • Posts: 958
  • Joined: 08-May 08

Re: How to deal with different browsers and positioning differences.

Posted 12 June 2008 - 11:00 AM

I thought that too, but for some reason it wouldn't work.. It's kind of shady and rickidy I'll admit, but it works.. I'm working on the being able to get it validated through w3.. Theres gotta be a way it can be valid..
Was This Post Helpful? 0
  • +
  • -

#4 skater_00  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 12
  • View blog
  • Posts: 256
  • Joined: 30-April 08

Re: How to deal with different browsers and positioning differences.

Posted 29 January 2009 - 11:20 AM

Using between <body> can't be valid according to W3C standards actually... Shouldn't be used between <html> for the code to be valid?
Was This Post Helpful? 0
  • +
  • -

#5 skater_00  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 12
  • View blog
  • Posts: 256
  • Joined: 30-April 08

Re: How to deal with different browsers and positioning differences.

Posted 29 January 2009 - 11:24 AM

EDIT: Using "head" tags between "body" tags can't be valid according to W3C standards actually... Shouldn't "head" tags be used between "html" tags for the code to be valid?
Was This Post Helpful? 0
  • +
  • -

#6 Winstinology  Icon User is offline

  • I'm pretty good with a laser mouse..
  • member icon

Reputation: 7
  • View blog
  • Posts: 958
  • Joined: 08-May 08

Re: How to deal with different browsers and positioning differences.

Posted 29 January 2009 - 01:53 PM

Yeah.. That was a slip up lol -- Just remember to put the tag in the right place when you do your own code okay :)
Was This Post Helpful? 0
  • +
  • -

#7 bzerm01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 09

Re: How to deal with different browsers and positioning differences.

Posted 16 July 2009 - 11:44 AM

It works fro me. With the body tag in the correct place.Thanks for sharing this code. BobbiZ
Was This Post Helpful? 0
  • +
  • -

#8 bzerm01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 09

Re: How to deal with different browsers and positioning differences.

Posted 16 July 2009 - 11:48 AM

Also I noticed that your comment tags are incorrect. they need to begin and end with
Was This Post Helpful? 0
  • +
  • -

#9 bzerm01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 09

Re: How to deal with different browsers and positioning differences.

Posted 16 July 2009 - 11:50 AM

>!-- and -- <
Was This Post Helpful? 0
  • +
  • -

#10 bzerm01  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 18-June 09

Re: How to deal with different browsers and positioning differences.

Posted 16 July 2009 - 11:52 AM

oops backwards code. lol <-- comment here -->
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1