Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Declaring Double Widths/Heights

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29498

    I saw a declaration that looked like this:

    Code:
    div#advert {
    width: 468px !important
    height 60px !important
    width: 470px
    height 62px

    }

    Why would you need to declare the width and height twice?

    #79053
    noahgelman
    Participant

    Well I can’t tell you exactly because I don’t know where you saw it but it looks like it might be border related. The size difference between them looks like it would be for a 1px border around it. Still though, why someone would need to do 2 heights and widths is beyond me.

    #79066
    virtual
    Participant

    That is a hack for IE6 it is used to feed Internet Explorer 6 and below special property values that are ignored by other browsers. In this case the height and width with !important will be ignored by IE6 which will use the second declared width and height. The other browsers will use the !important width and ignore the second one.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.