son Posted December 15, 2009 Share Posted December 15, 2009 I have in stylesheet an entry as:padding:0 4px 4px 0;which works well for non IE-browser.IE needs:padding:0 2px 2px 0;Is there some way to have sort of if-clause in stylesheet?Son Link to comment Share on other sites More sharing options...
Synook Posted December 15, 2009 Share Posted December 15, 2009 a) IE hackb) Conditional commentsBut first make sure you're not running in quirks mode.Edit: and as TS said, try a reset stylesheet as well. It could also be the margins affecting the result. Link to comment Share on other sites More sharing options...
thescientist Posted December 15, 2009 Share Posted December 15, 2009 you could just give everything a zero padding using the universal selector and then just apply those kind of things for each element as needed. But yes, certain browsers have their own default element paddings. Link to comment Share on other sites More sharing options...
bladexhunt Posted December 16, 2009 Share Posted December 16, 2009 I was reading about the padding trick with IE in an article about column based layouts in css, basically if you use padding in IE, it messes up sometimes, so you use div containers, and it should work. Also if you are using CSS make sure you have the strict doctype with your XHTML if you really want it to work, if its transitional or loose or HTML , IE will slip in to its own rendering, the strict DOCTYPE helps to to force it to work. Link to comment Share on other sites More sharing options...
son Posted December 22, 2009 Author Share Posted December 22, 2009 I have now the general padding in global stylesheet (works with latest versions of Firefox, Safari, Opera, Chrome) and add for IE (I verified for IE 7): <!--[if IE]><style type="text/css">.box {padding:0 2px 2px 0;}</style> Does anyone nowadays still bother with IE6? I always did, but now I am not sure if I should do a final test when project is finalised for IE6...Son Link to comment Share on other sites More sharing options...
thescientist Posted December 22, 2009 Share Posted December 22, 2009 It can't hurt, a lot of business still use it for security reasons, but I would make it the last browser to test for. Link to comment Share on other sites More sharing options...
GPSJane Posted December 22, 2009 Share Posted December 22, 2009 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">Try that at the top of your html doc. IE is a pain in the bum. Link to comment Share on other sites More sharing options...
thescientist Posted December 22, 2009 Share Posted December 22, 2009 Actually, it is always best to use a Strict Doctype, especially when working with wonky browsers, like IE. Standards are there for a reason, and a strict DTD will help ensure the browser follows the rules more. Link to comment Share on other sites More sharing options...
son Posted December 23, 2009 Author Share Posted December 23, 2009 Actually, it is always best to use a Strict Doctype, especially when working with wonky browsers, like IE. Standards are there for a reason, and a strict DTD will help ensure the browser follows the rules more.Thanks for your feedback...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.