Results 1 to 9 of 9

Thread: IE and 100% width?

  1. #1
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Unhappy IE and 100% width?

    Ok, I've done my best to keep from having to post this in the forums for others to help me with it since this is a submission of mine... However, I can't seem to find a "fix" for this issue.

    I created a CSS based horizontal menu which resembles the Vista look and feel. The problem with it is that it's set to 100% width. IE won't display the width at 100% if you zoom out your browser. If your browser is set to 100%, then it displays fine, but if you zoom out, then the menu shrinks UNTIL you hover over a menu item, then it re-expands and fills the entire width of the browser.

    I am nearly bald now from trying to figure this out. I have tried countless methods and hacks to try to get this to work right, but I can't seem to get it.

    Can anyone help?


    Here is the demo page:
    http://www.eight7teen.com/Vista_CSS_...ista_Menu.html

    and...

    Here is the source code:
    Code:
    <HTML>
     <HEAD>
      <TITLE> Vista Style CSS Menu </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="Josh Jones">
     <base href="http://www.eight7teen.com/Vista_CSS_Menu/" />
      <style type="text/css">
     /*///////////////Tried adding this to reset padding/margin thinking maybe that was the problem...////////////////////
     *{
      margin:0;
      padding:0;
      }
     ////////////////////////////////No avail///////////////////////////////////////*/
      body{
    background:#ababab;
    font-size:14px;
    font-family:Verdana;
    color:#505050;
    /*Thought maybe this little hack that is often used to keep footers at the bottom might be able to be used to make sure this thing stays 100% width*/
    width: auto !important;
    width: 100%;
    min-width:100%;
    /*End Footer Style percentage hack*/
    }
    
    #menubar{
    overflow: hidden;
    width: auto !important; /*This is the footer hack used in another area (still not working)*/
    width: 100%; /*This is the footer hack used in another area (still not working)*/
    min-width:100%; /*This is the footer hack used in another area (still not working)*/
    height:32px;
    background: url('images/menubar_x.png') repeat-x;
    padding: 0;
    }
    
    /*This was a suggestion from someone else which didn't work, then I added many other things to it, still didn't work*/
    * html #menubar{
    width: auto !important;
    width: 100%;
    min-width:100%;
    position:absolute;
    right:0px;
    left:0px;
    margin-right:0px;
    padding-right:0px;
    }
    /*End suggestion*/
    
    
    /*Begin Menubar Buttons CSS*/
    #menubar a.button{
    background: transparent url('images/button_left.png') no-repeat top left;
    display: block;
    float: left;
    line-height: 30px;
    height: 32px;
    margin-left:25px;
    padding-left: 12px;
    margin-right: 15px;
    }
    #menubar a.button:link, #menubar a.button:visited{
    background: transparent;
    display: block;
    float: left;
    font-family:Calibri, Arial;
    font-size: 18px;
    color: #ffffff;
    font-weight:normal;
    line-height: 30px;
    height: 32px;
    margin-left:25px;
    padding-left: 12px; 
    text-decoration: none;
    margin-right: 15px; 
    }
    #menubar a.button span{
    background: transparent;
    display: block;
    padding: 0px 12px 0px 0; 
    }
    /*End Menubar Buttons CSS*/
    
    
    /*Begin Menubar :hover & :active effect*/
    #menubar a.button:hover{
    background: transparent url('images/button_left.png') no-repeat top left;
    display: block;
    float: left;
    font-family:Calibri, Arial;
    font-size: 18px;
    color: #ffffff;
    font-weight:normal;
    line-height: 30px;
    height: 32px;
    margin-left:25px;
    padding-left: 12px;
    text-decoration: none;
    margin-right:15px;
    }
    #menubar a.button:hover span{
    background: transparent url('images/button_right.png') no-repeat top right;
    display: block;
    padding: 0px 12px 0px 0;
    }
    #menubar a.button:active{/*Note: "active" links only seem to work in IE*/
    background: transparent url('images/button_left.png') no-repeat top left;
    display: block;
    float: left;
    font-family:Calibri, Arial;
    font-size: 18px;
    color: #ffffff;
    font-weight:normal;
    line-height: 30px;
    height: 32px;
    margin-left:25px;
    padding-left: 12px;
    text-decoration: none;
    margin-right:15px;
    }
    #menubar a.button:active span{/*Note: "active" links only seem to work in IE*/
    background: transparent url('images/button_right.png') no-repeat top right;
    display: block;
    padding: 0px 12px 0px 0;
    }
    /*End Menubar :hover & :active effect*/
    
    
    /*Begin Menubar Left "Cap"*/
    #menubar .leftcap{
    background:url('images/menubar_leftcap.png') no-repeat;
    float: left;
    width: 5px;
    height:32px;
    position: relative;
    top: 0px;
    left:0px;
    }
    /*End Menubar Left "Cap"*/
    
    
    /*Begin Menubar Right "Cap"*/
    #menubar .rightcap{
    background:url('images/menubar_rightcap_search.png') no-repeat;
    float: right;
    width: 162px;
    height:32px;
    position: relative;
    top: 0px;
    right:0px;
    }
    #menubar .rightcap input{
    height:17px;
    width:132px;
    background:url('images/search_bg.png') no-repeat;
    color:#5E646F;
    font-size:10px;
    border:1px solid #254367;
    position:relative;
    top:7px;
    right:0px;
    }
    /*End Menubar Right "Cap"*/
    </style>
    </HEAD>
    
     <BODY>
     <h2>Josh's Vista Style CSS Menu Bar</h2>
    
    <!--Begin Menu HTML-->
      <div id="menubar">
      <span class="leftcap"> </span>
    
    <a href="#" class="button"><span>Home</span></a> 
    <a href="#" class="button"><span>About</span></a> 
    <a href="#" class="button"><span>Products</span></a> 
    <a href="#" class="button"><span>Services</span></a> 
    <a href="#" class="button"><span>Clients</span></a> 
    <a href="#" class="button"><span>Downloads</span></a>
    <a href="#" class="button"><span>Contact</span></a> 
    <a href="#" class="button"><span>FAQ</span></a> 
    
    <span class="rightcap">
    <input type="text" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" name="search" id="search"/>
    </span>
      </div>
    <!--End Menu HTML-->
     </BODY>
    </HTML>
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Use a proper DTD.

    You have:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    It should be:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/html4/loose.dtd">
    That should fix it (I think). By the way, why transitional?

  3. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Well, that at least gives it "uniformity" LOL

    Now instead of shrinking until you hover over a menu item... It just stays shrunk instead of re-expanding upon hovering over menu item.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  4. #4
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Quote Originally Posted by Medyman View Post
    By the way, why transitional?
    I just forgot to change it, I use EditPlus3 Text Editor and that's the default DOCTYPE placed at the beginning of each new document.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  5. #5
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by Nyne Lyvez View Post
    Now instead of shrinking until you hover over a menu item... It just stays shrunk instead of re-expanding upon hovering over menu item.
    That's how it's supposed to behave (in IE). Without javascript, you won't be able to keep the menu at 100% of the viewport at all times. View for a deeper understanding.
    Last edited by Medyman; 08-16-2008 at 08:39 PM.

  6. #6
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok, maybe something wrong with the wire speed

  7. #7
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Well that's a stupid idea! Why would IE have to be different than any of the others?
    *Ah yes, just remembered... Because Microsoft doesn't care about standards*

    I guess I'll just have to deal with it since I wanted to make it STRICTLY a css menu.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  8. #8
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by Nyne Lyvez View Post
    Well that's a stupid idea! Why would IE have to be different than any of the others?
    *Ah yes, just remembered... Because Microsoft doesn't care about standards*

    I guess I'll just have to deal with it since I wanted to make it STRICTLY a css menu.
    I actually think that the Microsoft model makes more sense here. If I'm zooming in/out of a page, I expect to do it uniformly.

  9. #9
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    I think I'd have to disagree... If zooming out... Then something which has the width defined as 100%, in my opinion should expand to fill the empty space and stay true to "100%".
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

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
  •