View Full Version : css for ie
davelf
11-04-2009, 06:33 AM
is it possible to make css only read for ie?
can i use this:
[if (IE 6) | (IE 5)]
can somebody give me example, please...
thx in advances
jscheuer1
11-04-2009, 06:41 AM
<link rel="stylesheet" href="main.css" type="text/css">
<!--[if lt IE 7]>
<link rel="stylesheet" href="old_ie.css" type="text/css">
<![endif]-->
Put your old IE styles in the old_ie.css stylesheet. They will supplement those in the main stylesheet, but only be read by IE 6 and less.
See also:
http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
for more info on how conditional comments work.
davelf
11-04-2009, 08:59 AM
thx john, it's works.
another question,
what the different between:
margin-left, padding-left, and left.
which one of them easier and saver for cross browser??
jscheuer1
11-04-2009, 01:52 PM
Margin is applied outside of the box, so if like it had a border, it would be added outside the border, if it had background, its background would not be seen in the margin area. Padding is the opposite - borders and background are extended. Both add to the overall layout space of the element and often appear to move it. The left property is meaningless unless the element is position fixed, absolute, or relative. It doesn't actually add anything to the element, just moves it around. All three of these can have different effects though cross browser. Different browsers give different default margins, and in some cases different default padding to certain elements. And as to whether or not padding or margin are added within the width or to the width dimension also varies in some.
Generally margin is safest, but it also depends upon what you want to do. When using the others, it is generally best to set the margin, if even just to 0, so that all browsers will be applying the other properties to the same base element.
For a fairly well organized css style technical reference that isn't too dense, with mention of how things vary in different browsers, see:
http://www.eskimo.com/~bloo/indexdot/css/index.html
davelf
11-05-2009, 12:50 PM
thx again for your great example and explanation. So the conclusion is, each script (padding, margin, left/right/top/bottom) have it's portion in css. I get it.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.