Results 1 to 5 of 5

Thread: css for ie

  1. #1
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default css for ie

    is it possible to make css only read for ie?

    can i use this:

    Code:
    [if (IE 6) | (IE 5)]
    can somebody give me example, please...

    thx in advances
    Last edited by davelf; 11-06-2009 at 01:48 AM.
    _____________________

    David Demetrius // davejob
    _____________________

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <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/libr...12(VS.85).aspx

    for more info on how conditional comments work.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    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??
    _____________________

    David Demetrius // davejob
    _____________________

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    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.
    _____________________

    David Demetrius // davejob
    _____________________

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •