Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11

Thread: min-width in IE

  1. #1
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts

    min-width in IE

    I found a work-around for the min-width problem in IE, my problem is I don't quite know how to implement it.

    Code:
    * html div#division { 
       width: expression( document.body.clientWidth < 334 ? "333px" : "auto" ); /* set min-width for IE */
       min-width: 333px; /* sets min-width value for all standards-compliant browsers */
      }
    Does the * html mean that this is good in the whole document?

    And I'm not too sure what the div#division is for.

    It's probably stupidly simple, I just kind of new to CSS and don't have all the protocol down yet.

  • #2
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    any thing with

    Code:
    * html
    in it is applying it to the whole document that has the style sheet applied to it

    "*" that is basically universal.

    Which site did you find this at, not sure what they are defining as "division", if you could give us a link we could take a look.

    you can also lay it out like this

    Code:
    * html #division
    you dont need the div.

  • Users who have thanked jcdevelopment for this post:

    j1adobe (07-14-2008)

  • #3
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    Last edited by effpeetee; 07-14-2008 at 03:02 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • Users who have thanked effpeetee for this post:

    j1adobe (07-14-2008)

  • #4
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Here is where the code originated:
    http://perishablepress.com/press/200...rnet-explorer/

    I've seen some other solutions, but they involve JavaScript and are very long and involved.

    This looks to be the simplest.

    jcdevelopment;
    I wondered about the div. Just wasn't sure.

    Frank;
    Thanks for the links.

    I appreciate the help. (and am astounded at the quick response! )
    Last edited by j1adobe; 07-14-2008 at 03:23 PM.

  • #5
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    well, from the looks of it they are just definging thier own div. I didnt know if it explained a certain div to use in your html. So you should be able to just name it whatever you want.

  • #6
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    JC,

    I have used the following "universal reset" which appears to cause odd problems.

    EDIT: Worth a try just to see what it does.

    Code:
    *{
    *:0;
    }
    Frank
    Last edited by effpeetee; 07-14-2008 at 08:54 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • Users who have thanked effpeetee for this post:

    jcdevelopment (07-14-2008)

  • #7
    Senior Coder jcdevelopment's Avatar
    Join Date
    Oct 2007
    Location
    Cowboy Nation
    Posts
    2,182
    Thanks
    174
    Thanked 257 Times in 257 Posts
    I have never seen that before

    Code:
    *{
    *:0;
    }
    what does CSS do with "*" as a property?

    EDIT** Sorry j1adobe i forgot to mention as a side not that "* html" i believe targets IE only..
    Last edited by jcdevelopment; 07-14-2008 at 03:30 PM.

  • #8
    New Coder
    Join Date
    Jan 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts
    I have used the following "universal reset" which appears to work.

    *{
    *:0;
    }
    Always looking to learn. What does this mean?

  • #9
    Senior Coder effpeetee's Avatar
    Join Date
    Feb 2007
    Location
    Clapham Junction - London SW
    Posts
    4,885
    Thanks
    228
    Thanked 204 Times in 203 Posts
    j1adobe

    Sorry, This is out of place here.
    Just doodling. I was wondering if the universal selector "*"was itself universal.

    Frank
    Last edited by effpeetee; 07-14-2008 at 03:41 PM.
    * Sources (updated: 21.11.2012.
    Using Windows 8 Professional. 64bit with HP Photosmart 5510 printer Very useful site here.

  • #10
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    As JC said, the * makes it universal. The things following it make it less universal, however. The "div" makes it apply to all <div> tags unless specifically refuted somewhere else. The "#division" is a specific with some object (a div most likely) identifying it. Only one can legally exist as the "#" makes it very specific.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #11
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    And I'm not too sure what the div#division is for.
    See, if I have a CSS
    Code:
    .mystyle{
    color:red;
    }
    The above rule is applicable to all elements having a class="mystyle", say
    Code:
    <div class="mystyle">some text here</div>
    <p class="mystyle">some other text here</p>
    <span class="mystyle"> even more ....</span>
    Now, If I want to change the background color of that <div> only , I can't apply it directly to the .mystyle selector, since it will change the behavior of my other elements having the same class.

    The solution is
    Code:
    div.mystyle{ /*no space between div and dot */
    background:black;
    }
    (if we put some space before that dot, div .mystyle , then it'll become a different rule)

    Similarly div#mystyle explicitly specifies that this particular rule is applicable to a <div> having id="mystyle".

    Since, it's not possible to have more than one element with same value for id in a single document, we can interchangeably use div#mystyle or #mystyle

    But, if it's an external style sheet, shared by more than one document, both of them can play different roles on different pages.

    After all, sometimes I prefer to use div#mystyle even if there is no element in any of the pages having an id="mystyle", so as to easily convey that my element with id="mystyle" is <div>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    j1adobe (07-14-2008)


  •  

    Posting Permissions

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