Forums

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

Home Forums CSS Set div width issue in IE7

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #44470
    amitavak
    Participant

    Hi all,

    I’m facing a css issue. In IE7, I set a div width to “auto” to set the div width according to the div content. But it does not work. IE8 works fine. All css property I set in the div are

    /* Inline properties */
    left: 571px;
    top: 310px;
    overflow: hidden;
    margin-top: 0px;
    margin-left: -22px;
    display: block;
    filter: alpha(opacity=1);
    position: absolute;
    z-index: 311;

    /* style applied using a class */
    .labels
    {
    color: red;
    background-color: white;
    font-family: “Lucida Grande” , “Arial” , sans-serif;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    border: 2px solid black;
    white-space: nowrap;
    z-index: 8768;
    opacity: 1;
    min-width: 30px;
    width: auto;
    filter: alpha(opacity = 100) !important;
    }

    For reasons, I could not change Inline properties( position, overflow, top, left, zIndex, display, marginLeft, and marginTop).

    If I remove width or minwidth, div width became 0. div width change with the value of minwidth or width. But I want that div width should change with it’s content.

    Any help on this is much appreciated.

    #133683
    SgtLegend
    Member

    This isn’t an answer but a reason why IE7 should be dropped from your browser list, currently global statistics show IE8 at around 9% of all web traffic which is extremely low and IE7 is even lower at 2-3% of all web traffic. Considering how low these numbers are I would personally set the baseline as IE9 as the chances someone visiting your website in IE 7/8 is extremely low as around 95-98% of corporations in the world use them still use them.

    From a consumer level you would see higher traffic sources coming from Google Chrome, Firefox, Safari and IE9+

    #133694
    amitavak
    Participant

    That’s true. But what to do if your client still using IE7.

    #133716
    amitavak
    Participant

    ok..finally the issue is solved by setting the style “overflow: visible !important” for the “labels” class.

    .labels
    {
    /*………previous styles………..*/

    overflow: visible !important
    }

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