CSS - Ie: Width: Auto Issue
Afternoon Folks!
Have a seemingly simple problem here but I can't seem to figure it out. I have a Horizontal drop-down CSS menu. It's working really well in FF but our fav friend IE is reading it differently. I'm using a list for my nav, with an auto width and 15px padding left/right. But in IE it registers my width as 100% so my horizontal menu turns into a vertical menu. edit:: using IE6 as my base test simply because IE7 isn't an "Approved Software" for work yet.. haha! I'm about to head out to lunch in a few and wanted to see if some CSS wiz's could slap me and help me find the best solution for my needs. I'm sure it's simple and I just keep scimmin right over it. So I uploaded what I have for it. It can be seen here This is the style which defines my width: css Code: Original - css Code #pmenu a, #pmenu a:visited { display:block; padding: 0 15px; width: auto; font-size:11px; color:#fff; height:25px; line-height:24px; text-decoration:none; border-right: 1px dotted #fff; } #pmenu a, #pmenu a:visited { Of course, any and all help is appreciated! TYTY! TIA! Lates! Similar TutorialsCurrently on my site I have articles with images, and the images have a quote underthem... unforutunatly, i have to manually set the width of these boxes to the width of the image that accompanies them.... here is a sample... CSS: Code: .imageinsert { margin:5px; } #image01 {width:225px} .imagequote { color:#FFF; font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:11px; text-align:center; } XHTML: Code: <div class="imageinsert" id="image01"> <img src="/pic/feud093.jpg" alt="" /> <div class="imagequote">In yet another unfair battle, Maki must defend herself against Guy and Guile!</div> </div> I would love to have just one code for the imageinsert tag that would just autoresize based on how wide the image was. It always amazes me how Microsoft can mess something up that was working before. Take the following example, a table cell set to a specific width, containing a div, width set to 100% of its containing block element (the table cell). Overflow:auto is applied to the div and content is placed in the cell that cannot be wrapped. See the code that follows: html4strict Code: Original - html4strict Code <table width="200px" cellpadding="0" cellspacing="0" border="0"> <tr> <td style="width: 200px;"> <div style="width: 100%; overflow: auto;"> <p style="white-space: nowrap;">Content that should not be wrapped.</p> </div> </td> </tr> </table>
One would expect to have the table cell display with a width of 200 pixels and scrollbars will be displayed for the un-wrappable content. IE7 does not do that. It widens the cells width to accommodate the content. FF follows this perfectly. To fix this, one has to set the div to the same width as the table cell, like so: html4strict Code: Original - html4strict Code <table width="200px" cellpadding="0" cellspacing="0" border="0"> <tr> <td style="width: 200px;"> <div style="width: 200px; overflow: auto;"> <p style="white-space: nowrap;">Content that should not be wrapped.</p> </div> </td> </tr> </table>
Only then, IE7 will correctly display it. Just something to keep in mind when working with percentage widths. hello everyone, i am using css based menu . requirement is that, menu should adjust its width automatically based on the text length. Here is my css : = css Code: Original - css Code li ul li { background: #000; color: #fff; padding-top: 4px; border-bottom: 1px solid #fff; letter-spacing:1px; text-transform: capitalize; text-shadow: 2px 2px 2px #22222; width: 250px; margin:0px auto; height: 18px; font-size: 11px; font-weight: normal; text-align:left; filter: alpha(opacity=80); opacity: 0.8; -moz-opacity: 0.8; }
you just see the attachment, you would realise that , the text is cropping & not displayed. Also , can any one suggest , what can I do to make this CSS to cause make it attractive.? Hi All, I have CSS-sheet= .thumbs { border: 2px solid #524b2f; position: static; height: 80px; width: auto; } body { background-color: #f5f0ec; font-family: Verdana, Arial, Helvetica, sans-serif; scrollbar-face-color : #f5f0ec; scrollbar-highlight-color : #aca899; scrollbar-3dlight-color : #f5f0ec; scrollbar-shadow-color : #aca899; scrollbar-darkshadow-color :#f5f0ec; scrollbar-track-color : #f5f0ec; scrollbar-arrow-color : #524b2f; } The thumbs part resizes some pictures to a fixed height of =80px and calculates the width so everyting is resized correctly. But IE6 gives problems with the width=auto , some times it's sets the widt correctly other times it doesn't. In other brouwsers its fine. Any suggestions on fixing this in IE6? here's the page link : http://www.sleuyter.be/04/lay04-1.htm thx, ROY Hi to all, and thanks a million in advance for help. I have developed a simple online cms and everything is setup correctly but i am stuck at one place. I am unable to make width to 100% when b div is empty i mean a div = 50% width, b div = 50% width, how set it up that when a div is empty then b div goes to 100%width and when b div is empty then a div is 100% width. i hope got my question. because currently i have set in this way. wrapper div = 980px width, a div = 50% width, b div = 50% width, wrapper div end so when a div is empty then b div is still present and that area is empty it destroy the whole look. thanks arsslan I'm designing a page he (URL address blocked: See forum rules) I'm confused on how to make the top bar image span the width of each side and still be in synch with the center background image. I've done this with tables on the old version of the site (here ), but is it possible with CSS? Here's the code for the bars currently: .BGLEFTTOP{ position:absolute; left:0%; top:0px; height:88px; width:50%; margin-left:-456; background:url((URL address blocked: See forum rules)) repeat-x; background-position: right top; z-index:1;} .BGRIGHTTOP{ position:absolute; right:0%; top:0px; height:88px; width:50%; background:url((URL address blocked: See forum rules)) repeat-x; background-position: left top; z-index:1;} Alrighty, I'm trying to produce a layout similar to that of what is shown in the attached image. Please ignore the image being the rainbox colors, but I had to differentiate sections. I can get the banner/search line to appear properly, but the rest will not. Left menu gets positioned fine, the content does as well (more or less), but the right column is displaced, and shifted down to the very bottom of the window -- far right, though. I can't explain much better than that, so without further ado: CSS: Code: .columns-float{ float : left; width : 80%; } .column-one { width : 75%; /* NOTE: This needs to be dynamic! THIS is what I'm inquiring about. The above problem assumes this attribute is set to "auto". */ float : right; } .column-two { width : 25%; float : left; } .column-three{ width : 20%; float : right; } .box-footer{ clear : both; } .column-one-content{ margin-left: 1px; margin-right: 1px; } /*Hack below:*/ .box-wrap, .columns-float, .column-one, .column-two, .column-three, h2{ p\osition: relative; } (Above was borrowed from here, albeit with modifications.) HTML: Code: ... <div class="columns-float"> <div class="column-one"> <div class="column-one-content"> <h2>column 1</h2> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p><a href="#" title="fake link for testing">test link</a></p> </div> </div> <div class="column-two"> <div class="column-two-content"> <h2>column 2</h2> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p><a href="#" title="fake link for testing">test link</a></p> </div> </div> <div class="box-clear"> </div><!-- # needed to make sure column 3 is cleared || but IE5(PC) and OmniWeb don't like it --> </div><!-- close boxbody --> <div class="column-three"> <div class="column-three-content"> <h2>column 3</h2> <p>column filler</p> <p>column filler</p> <p>column filler</p> <p><a href="#" title="fake link for testing">test link</a></p> </div> </div> <div class="box-clear"> </div><!-- # needed to make sure column 3 is cleared || but IE5(PC) and OmniWeb don't like it --> <div class="box-footer">Footer </div> Do not link me to Position Is Everything. Been there already, and it wasn't helpful; the used terminology was too abstruse for me. Any help would be appreciated, and I thank you very much for your time. This is driving me batty. If you could please see this page: http://pnlab.soundwebdev.com/PostCalendar.phtml compare in IE vs. Firefox (or anything good ) You will see that in IE the content of the right column shifted below the last thing in the left column. I believe this is because IE thinks that the right-col content is too wide and so shifts it down. Obviously, I don't want that. because this is a dynamic-content site (Postnuke), I can't just change the width of the content on the right-col, so the solution has to be in the template or the css. template: http://pnlab.soundwebdev.com/themes...ates/master.htm (view source) css: http://pnlab.soundwebdev.com/pnTemp...imple.style.css any ideas? puulllease? my site looks different in IE9. The red block on the right of Find Us shifts down onto the next line but in IE8 firefox and opera it displays fine. Is there a way to sort this without conditional statements or do i need to redo the menu set up agian? Here is a snippet of the css for the menu: Code: #topMenu { width:960px; position:absolute; bottom:0;} ul#menu { margin:0; padding:0; list-style-type:none; width:auto; position:relative; display:block; font-size:16px; } ul#menu li { display:block; float:left; margin:0; padding:0; } .left { width:206px; background-color:#d30507; height:19px; } .right { width:55px; background-color:#d30507; height:19px; } ul#menu li a { display:block; float:left; color:#fff; text-decoration:none; padding:0px 20px 0 20px; border-right: 1px solid #d30507; } ul#menu li a:hover { color:#fff; background: #d30507; } ul#menu li a.current { display:inline; color:#fff; background: #d30507; float:left; margin:0; } Hi all, I'm having a little trouble getting my CSS rounded border to display correctly. I've neally got it however i am unable to sort out the right hand side alignment. I want it to be 234px wide, at the moment i have the width set at 100% but whenever i change this value to anything smaller or a fixed width i get all kind of incorrect output. You can see the code he Code: <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <STYLE type="text/css" media="all"> @import url( css/commonDesignA.css ); </STYLE> </head> <body> <BR><BR> <!-- START: Boxed Cell Information Cell --> <div class="wpFieldSetCornerTopLeft"></div> <div class="wpFieldSetTopCenter"></div> <div class="wpFieldSetCornerTopRight"></div> <div class="wpFieldSetCenter"> <div class="wpFieldSetCenterContent"> <!-- START: Boxed Cell Information Cell Content --> <Span class="mytpPanelHaeding">Test</span> <!-- END: Boxed Cell Information Cell Content --> </div> </div> <div class="wpFieldSetCornerBottomLeft"></div> <div class="wpFieldSetBottomCenter"></div> <div class="wpFieldSetCornerBottomRight"></div> <!-- END: Boxed Cell Information Cell --> </body> </html> ...and the CSS file: Code: .panelHeading { COLOR: #982E33; } /* *** Field Set Corner/Center Styles ** */ .wpFieldSetCornerTopLeft { font-size: 0px; float: left; vertical-align: top; width: 4px; height: 4px; background-image: url(../images/borders/top_left.gif); background-repeat: no-repeat; } .wpFieldSetCornerTopRight { font-size: 0px; float: right; vertical-align: top; width: 4px; height: 4px; background-image: url(../images/borders/top_right.gif); background-repeat: no-repeat; } .wpFieldSetCornerBottomLeft { font-size: 0px; float: left; vertical-align: top; width: 4px; height: 4px; background-image: url(../images/borders/bottom_left.gif); background-repeat: no-repeat; } .wpFieldSetCornerBottomRight { font-size: 0px; float: right; vertical-align: top; width: 4px; height: 4px; background-image: url(../images/borders/bottom_right.gif); background-repeat: no-repeat; } .wpFieldSetTopCenter { font-size: 0px; float: left; vertical-align: bottom; height: 4px; width:234; background-color: #ffffff; border-top: 1px solid darkblue; } .wpFieldSetBottomCenter { font-size: 0px; float: left; vertical-align: top; height: 4px; width:234; background-color: #ffffff; border-bottom: 1px solid darkblue; } .wpFieldSetCenter { float: left; width: 100%; background-color: #ffffff; } .wpFieldSetCenterContent { padding-right: 10px; padding-left: 10px; padding-bottom: 0px; padding-top: 0px; border-right: 1px solid darkblue; border-left: 1px solid darkblue; } BODY { BACKGROUND-IMAGE: url(../images/bg_gradient_blue-D7E8F0.jpg); BACKGROUND-COLOR: #d7e8f0; BACKGROUND-repeat: repeat-x; background-attachment: fixed; MARGIN: 0px; } Any help greatly appreciated. Cheers. Hello, I'm building a site for a friend and I have an issue on older IE browsers with the page expanding horizontally out of bounds when the content reaches more than 100% of the viewport. Could someone offer me a solution for this problem? It works properly on Moz and IE8. The anomaly can be viewed on this page: http://mercurial.pri.ee/Esaber/isabel.html My CSS files are as follows: http://mercurial.pri.ee/Esaber/styling.css http://mercurial.pri.ee/Esaber/table.css Web page: http:/ / www. diffentest.pikadoo.com / difference / index.php?title=Mouse_vs_Rat CSS location: http:/ / diffentest.pikadoo.com / difference / skins / mistylook / main.css Works perfectly in FF, Safari and Opera. Problem: In IE6, #entityfamilies div has a width problem. If I specify width as 75%, it takes 75% of parent div whereas the other browser's seem to be considering window width. The second problem with IE6 is that the div scrolls away with the page (I don't want it to - and it remains static in FF). The problem with IE7 is that the entire div vanishes from the view. Any help will be greatly appreciated. I have been working this for hours and no sleep yet on Friday night. Hi all. I'm having a problem with the header of my web page. I want it to extend across the entire page but can't seem to get it to do so. When I change the width, the header extends to the right only. the url is spatterblog, can view using firebug the css is: #header { background: #e75c14 url('images/img02.gif') repeat-x center center; } #headerimg { margin: 7px 9px 0; height: 192px; width: 100%; #headerimg .description { font-size: 1.2em; text-align: center; } #header { background-color: #e75c14; margin: 0 0 0 1px; padding: 0; height: 200px; } having a problem ;-) Why else post here right ?? well please have a look at http://www.furastadesigns.com/kfn/ using firefox,, see the pulldowns ? they are correctly sized when the pulldown is dropped. But in Explorer they are keeping the same size as the mainbox (not the pulldown) I tried controlling the option tag but using width:; but that works only in firefox. Any ideas on how to make the option (the pulldown list) bigger then the main box in firefox ??.. Thanks alot... I'm working on a site layout using CSS. I want the content body and the top menu to expand the width of the browser. For some reason, in Safari, the content body works, but the top menu does not. Any suggestions? HTML: <div id="mainmenu"> <div id="mainmenutext">Menu will come here.</div> <div id="mainmenuspace"> </div> </div> CSS: #mainmenu { height: 27px; width: auto; border-top-width: 3px; border-top-style: solid; border-top-color: #000000; background-color: #FDDAE4; clear:both; position: absolute; left: 0px; top: 150px; } #mainmenutext { margin-left: 4px; color: #000000; height: auto; width: auto; } #mainmenuspace { float: right; height: auto; width: auto; } www.mrossana.com/siteidea/ www.mrossana.com/siteidea/style.css Thanks! CSS 1, Netscape 4.x and background+width issue need workaround: I am working on a website template and converting it to CSS. I have seperated my CSS1 from my CSS 2 sheet and am currently trying to get NN 4.x to do what I have read it won't do and have no idea how to make it do what I want. BTW:Please do not advise me to drop NN 4.x, unfortunately it is not within my power to do so. What I need to do is put a background color on an H1 header that will be only as wide as the table cell (column) it is in. (3 column plus header and footer layout). BTW: I cannot drop the table either. My problem is that when I get the background to work (instead of just surrounding the text) I cannot get it to be liquid and remain inside its cell. When I set the width to %'s it just pushes the other 2 columns out of the way even when the % is not the width of the column. Unfortunately, pixels are not flexible enough for this layout. So, how do I get a background color on an H1 tag that fully expands to the width of the column (not just the text) using CSS 1 and NN 4.x while not destroying the table layout? Thank you for your help- Schach PS: This is not an issue of my code, but an issue of the NN 4.x CSS support. So I do not need to have the code debugged, but instead I need a hack or method to outsmart the browser, so I can duplicate a site in CSS. This site is currently heavily reliant on tables, something we want to change, but can't unless we can reproduce the site in NN 4.x. (You can email me if you would like to do that) So I'm having what I think are CSS issues with a site... I'm supposedly a "new user" though I've been registered for a long time, and just not used this account in a long time, so I can't show my URL's here... tried to abbreviate them... I'm not sure how to show you what the issues are if I'm not allowed to post URLs. Anyone with any suggestions there? This looks fine in IE, but not in Firefox. On (blocked) the main content that sits in the middle of the page sits in an 800px div called "page". I've set the background color for that to be white: FFFFFF, which Internet Explorer seems to understand. But Firefox seems to be leaving "page" to be transparent. This means that either the left div (content) or the right div (reef-job) ends when the content inside of it ends, rather than continuing down to the bottom of the "page" content. I'm not sure how to fix it for Firefox. Again, it's all the pages inside of (carrieandjonathan [dot] com /island-reef-job) and the stylesheet is at (carrieandjonathan [dot] com / island-reef-job / mt-island-reef-job.css) #page { width: 800px; margin: 0 auto; padding: 0px 0; background-color:#ffffff; } Any help is greatly appreciated. Thank-you in advance! Warmest, Jonathan I am building a custom form control that behaves more or less like a <select> menu. For the dropdown portion of the menu, I need to set a max-height. If the dropdown contains enough options to go beyond the max-height a vertical scrollbar should appear. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Custom Auto-Complete</title> <script type="text/javascript"> <!-- function initPage() { } --> </script> <style type="text/css"> <!-- body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 76%; } input { width: 200px; background: #f4f4f4; border: 1px solid #999; font-size: .9em; /* */ } .clearfix { display: inline-block; } .clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; } .cAutoCompleteCtl { position: relative; /* border: 3px solid red; */ } .cAutoCompleteCtl input { margin: 0 5px 0 0; display: block; float: left; } .cAutoCompleteCtl a.dwnarrow { width: 15px; height: 15px; border: 1px solid #999; background: url(images/downarrow.gif) no-repeat; background-position: center center; background-color: #efefef; float: left; display: block; font-size: 1px; text-decoration: none; } .cAutoCompleteCtl .acCtlDropdwn { position: absolute; top: 20px; left: 0px; z-index: 100; visibility: visible; min-width: 300px; max-width: 600px; height: auto; max-height: 200px; background: #fff; padding: 5px; border: 1px solid #999; overflow: auto; /* width: 400px; */ } * html .cAutoCompleteCtl .acCtlDropdwn { width: expression( this.scrollWidth < 330 ? "300px" : ( this.scrollWidth > 620 ? "600px" : "auto" ) ); height: expression( this.scrollHeight < 20 ? "200px" : ( this.scrollHeight > 301 ? "300px" : "auto" ) ); } .cAutoCompleteCtl .acCtlDropdwn a { white-space: nowrap; display: block; text-decoration: none; padding: 2px 5px; color: #000; border: 1px solid #fff; } .cAutoCompleteCtl .acCtlDropdwn a.lastOption { } .cAutoCompleteCtl .acCtlDropdwn a:hover { background: #f5f5f5; border: 1px solid #b3b3b3; } --> </style> </head> <body onload="initPage();"> <div class="cAutoCompleteCtl clearfix"> <input type="text" /><a href="" class="dwnarrow"> </a> <div class="acCtlDropdwn"> <!--<a href="#">options here options here options here options here options here options here options here options here options here options here options here</a>--> <a href="#">options here</a> <a href="">Boulder Logic</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> <a href="">A Rference With A Different Name</a> </div> </div> </body> </html> I'm seeing some unexpected behaviour ihn Firefox. When the page is loaded for the 1st time, the height of the dropdown portion of the menu is only large enough to see 1 option and no scrollbars are displayed. If I hit refresh (without holding the Shift key), the menu's height goes to its max-height and displays as expected. The only property I could find that has any effect on this behaviour is overflow. If I remove it all together or set it to scroll, it displays at the correct height. Unfortunately, neither of these are an option since they will not produce the desired scrolling behaviour. Can anyone see where I'm going wrong? |