Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 12-28-2007, 10:32 PM
digitaloverlay's Avatar
digitaloverlay digitaloverlay is offline
Junior Member
 
Join Date: 12-14-07
Location: Virginia Beach
Posts: 21
iTrader: 0 / 0%
Question: How do I call specific CSS for ie?

As the title indicates, I am having some problems with ie (who isn't). I am creating a CSS layout and see that my layout isn't the same for FF and IE so I wanted to make one for IE to be called if the user is using that browser. After searching the web I found the hack to implement this but it isn't working.

This one is for greater than or equal to ie 6.

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

One for ie 6 only.

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

The others are similar. Here is the ref site: http://www.thesitewizard.com/css/excludecss.shtml

here is my test page (for now): http://www.digitaloverlay.com/rd/index2.htm

Thanks gang for helping me out.
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 12-29-2007, 01:03 AM
digitaloverlay's Avatar
digitaloverlay digitaloverlay is offline
Junior Member
 
Join Date: 12-14-07
Location: Virginia Beach
Posts: 21
iTrader: 0 / 0%
Update: I have scoured the web and seem to be doing the code just as it should be but it just isn't working. It sucks that it is 3AM here and no on is one to read this, I could really use the sanity check.

I am able to get the results of the conditional comment but it is not calling the css file.
 
Reply With Quote
  #3  
Old 12-29-2007, 04:15 AM
megamoose's Avatar
megamoose megamoose is offline
v7n Mentor
 
Join Date: 06-04-06
Location: Guildford
Posts: 557
iTrader: 2 / 100%
I read somewhere that IE7+ has stopped the specific CSS things from working (thanks Microsoft).

Because I know you used to be able to do something like *:HTML and only IE would pick it up, or something like that.

Hopefully someone can help you out, but in general IE sucks and I have just come up with the conclusion that if the majority of the site works, is attractive and readable except for one little padding pixel being out of place, then just forget about it. Take megamoose.net for an example, the top header looks horrible in IE but I couldn't give a hoot

Mark
 
Reply With Quote
  #4  
Old 12-29-2007, 04:18 PM
digitaloverlay's Avatar
digitaloverlay digitaloverlay is offline
Junior Member
 
Join Date: 12-14-07
Location: Virginia Beach
Posts: 21
iTrader: 0 / 0%
Problem Solved

After reading the following websites, I converted my HTML to XHTML and ensured that my ref links were in the head section. Everything works well now with loading CSS files based on browser. If you have IE and FF (or other browsers like I do) then you may test my pages on your browsers. Keep in mind that the backgrounds may not be what I am going to use for the real site but wanted to make sure that they were different for the ie browser.

Research links for browser specific CSS files:
http://www.quirksmode.org/css/condcom.html
http://www.elated.com/articles/inter...onal-comments/

My test page:
http://www.digitaloverlay.com/rd/index2.htm

Thank you for reviewing.

Take care everyone.
 
Reply With Quote
  #5  
Old 02-19-2008, 09:25 PM
danparks's Avatar
danparks danparks is offline
Junior Member
 
Join Date: 02-19-08
Posts: 13
iTrader: 0 / 0%
you're on the right track...

Quote:
Originally Posted by digitaloverlay View Post
As the title indicates, I am having some problems with ie (who isn't). I am creating a CSS layout and see that my layout isn't the same for FF and IE so I wanted to make one for IE to be called if the user is using that browser. After searching the web I found the hack to implement this but it isn't working.

This one is for greater than or equal to ie 6.

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

One for ie 6 only.

<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="iespecific.css" />
<![endif]-->
Seems like you're doing it correctly. Make sure your order is correct, as in list a css file you always want first, then add additional files after. Each additional file includes *only* css overrides that pertain to the browser of interest. In the following example the first file (cssSiteAll.css, located in a directory named css) has all the css in it, and it works in non-IE browsers like FireFox. Then, the next file (cssSiteIEAll.css) holds only css that is needed to correct problems that occur when viewing your site in any IE browser. It doesn't copy the entire cssSiteAll.css file - it only holds the changes needed for IE to look good. Other, non-IE browsers will ignore this css. Next, if there is something that looks good in IE6 or less, but shows up bad in IE7, the third css file holds css for just those corrections.

<link href="css/cssSiteAll.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="css/cssSiteIEAll.css" rel="stylesheet" type="text/css" />
<![endif]-->
<!--[if IE 7]>
<link href="css/cssSiteIE7.css" rel="stylesheet" type="text/css" />
<![endif]-->

Somewhat confusing, but try it out - it works.

Dan
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick question - What do you call the type of internet CommandD Marketing Forum 8 10-03-2007 08:05 AM
When I have no specific question to ask...... Batch Forum Lobby 18 12-29-2006 01:00 PM
Directing specific users to a specific folder Kenny Fix Coding Forum 3 03-19-2006 08:57 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 03:31 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC