Forums

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

Home Forums Other height auto important

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #43734
    devil3682116
    Participant

    I am using skeleton framework to do css, i give height:auto!important to a div now when i resize the screen to mobile view it takes same height..is there any way to change the height …..i change the height in media query too but it takes the same height..

    #130004
    yoyo
    Participant

    height with !important has always more weight than the other one, that may be the problem , why you use ** !important** ?

    #130007
    devil3682116
    Participant

    its ie6 and ie7 hack
    div{ min-height:275px; height:auto!important; height:275px; }

    #130010
    yoyo
    Participant

    i don’t know the usage of !important

    **min-height:275px** and **height:auto** is enough,**height:275px** is unneccasary i think

    #130011
    devil3682116
    Participant
    #130027
    Paulie_D
    Member

    Why are you trying to hack IE6 & 7 for a mobile view? It won’t be found on any mobile device.

    #130033
    Kitty Giraudel
    Participant

    > i don’t know the usage of !important

    It’s called the bang hack. It relies on the inability for Internet Explorer 6 to understand `!important`. Basically, you set whatever you like with the hammerbash flag, then you override it with whatever you like for IE6 only.

    So in our case:

    .my-element {
    height: auto !important;
    height: 275px;
    }

    … results in `height: auto` for everyone except for IE6 which will apply `height: 275px`.

    Problem with this hack is it may involve some specificity problems.

    #130040
    Senff
    Participant

    Perfect example why any type of hacks should be avoided as much as possible.

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