Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Conditional comments chaos


  • Please log in to reply
5 replies to this topic

#1 webrat

webrat

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:04:02 AM

Posted 19 January 2009 - 10:09 AM

Hey folks,

The topic pretty much covers it.

I've recently had to re-do a nav-menu and introduce it to my existing site due to expanding content. I'm using a seperate stylesheet for the menu (imported 1st), another for firefox (2nd) and a final conditional commented one for IE (last in the 'stack'). Up to now, changes to the IE sheet have worked fine and done exactly what I expected. But since introducing the nav-menu/stylesheet only the Firefox stylesheet registers any changes on the site when altered, the IE 'sheet now seems to be completely ignored. Anyone got any idea why this might be?

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:02 PM

Posted 19 January 2009 - 11:26 AM

It could be something as simple as a typo in the style sheet, or a mistyped URL. Could be anything really.

#3 webrat

webrat
  • Topic Starter

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:04:02 AM

Posted 21 January 2009 - 05:09 AM

Hey groovicus,

Looks like we were both right, strangely enough. I looked carefully at the code on several pages (which I'd deliberately made very similar) and found that I had inline elements above floated block elements. I didn't expect this to cause a problem as I had given them a fixed width but it certainly did. The moment I changed the inline elements to block elements the pages snapped back into order.

The interesting thing (from my perspective) was that the IE stylesheet seemed to give up trying to interpret what was going on and left it with the Firefox stylesheet to deal with. Only after resolving the inline/float issue would the IE sheet respond to changes, and yet the Firefox sheet contiued to work throughout no matter how mangled the page was.

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:02 PM

Posted 21 January 2009 - 07:22 AM

For all the whining people do about IE (not that you were), IE is actually very strict Bout having well formed HTML, properly formatted CSS, etc. Firefox is able to handle many of the errors and still display properly. The problem with Firefox is that it will sometimes hide where the error really is, making it harder to debug. For example, if one forgets a closing table tag, the table may still render as desired, but a button or div further down the page may not render correctly, even though the html for that particular element is correct. I think I prefer the strictness of IE.

#5 webrat

webrat
  • Topic Starter

  • Members
  • 138 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:UK
  • Local time:04:02 AM

Posted 22 January 2009 - 09:31 AM

All Hail groovicus!

Why?

I still was not happy with the result of the above as it did not work with all pages. IE did exactly as you predicted.

A minor parse error on the IE stylesheet above certain pages caused IE to go into meltdown. Firefox just carried on as if nothing had happened, even if forced to rely on the 'broken' sheet. Very strange, very confusing and very definitely worth signing up to BC to learn about.

Many thanks.

Jason

#6 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:09:02 PM

Posted 22 January 2009 - 09:52 AM

I don't know why IE is that way specifically, other than when the developers designed the parser, they decided that the proper way to do so was to make sure that everything was well formed.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users