CSS - Css Width Error In W3.org????
Hi, I dont get this,
I have this code: Code: @media screen and (min-width: 1023px){ #menu {float:left; width:756px; margin:0; padding:0 5px 0 5px;} #menu ul {list-style:none; margin:0; padding:0; width:150.2px; float:left;} #menu ul ul .level3{width:355px;} #menu ul ul .level4{width:200px;} #menu ul ul .level5{width:240px;} #menu ul ul .level6{width:150px;} #menu p {display:block; border-width:1px; border-style:solid; border-color:#ccc #888 #555 #bbb; margin:0; padding:2px 3px; color:#000099; text-align:center;background:url("background5.gif"); font-family:Verdana, Arial, Helvetica, sans-serif; font-size:13px; font-weight:bold;} #menu ul ul .level2{display:block; border-width:1px; border-style:solid; border-color:#ccc #888 #555 #bbb; margin:0; color:#000099; background:#FFFFFF; text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; padding-left:1px; padding-top:3px; padding-bottom:3px; text-decoration:none; width:200px;} #menu a.links{display:block; border-width:1px; border-style:solid; border-color:#ccc #888 #555 #bbb; margin:0; color:#000099; background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; padding-left:1px; padding-top:3px; padding-bottom:3px; text-decoration:none;} #menu ul ul .level2:hover {color:#000099; background:#FFFF66;} #menu a.links:hover {color:#000099; background:#FFFF99;} #menu a.topmenu{text-decoration:none;} #menu a.topmenu:hover {color:#000099; text-decoration:none;} #menu li:hover {position:relative; z-index:500;} #menu ul ul {position:absolute;} #menu ul ul ul {top:-1px; left: 100%;} div#menu ul ul, div#menu ul li:hover ul ul, div#menu ul ul li:hover ul ul {display: none;} div#menu ul li:hover ul, div#menu ul ul li:hover ul, div#menu ul ul ul li:hover ul {display: block;} } And w3.org checker gives me this error: Feature width doesn't exist for media screen Does not get it, cant I use width inside @ media? Dont see how I can do it without out. Thanks Helen Similar TutorialsI'm new to the forums here and wondering if anyone can help me out with a little problem I'm getting. http://brandonblume.commerceculture.co.uk/ What I want is for the top banner to be on top of everything and the left navigation menu to be at the left of everything and for the rest of the page to be in whatever's left of the browser space. I want the news text boxes to fit 100% into the extra space. Firefox does this fine but when you view it in Internet Explorer the news boxes take up 100% of the space plus some additional space of the exact same x dimensions as the navigation bar. So you have to scroll right to see the whole page. A workaround is to limit the size of the news boxes but I don't really want to do that. Also, the footer notes on my webpage are centered only according to the browser window, it seems, and not according to the blank space area. Here's my current sheet. ul.banner is the top banner, ul.navbar is the left menu, and ul.body is the extra space. Code: body { margin: 0; padding: 0; font: 10pt "Helvetica"; color: #BCCACE; background: url(fade-to-black.gif) #161616; background-repeat: repeat-x; background-position: 0px 74px; scrollbar-face-color: #14192A; scrollbar-highlight-color: #303F56; scrollbar-shadow-color: #303F56; scrollbar-3dlight-color: #14192A; scrollbar-arrow-color: #9CA9AD; scrollbar-track-color: #161616; scrollbar-darkshadow-color: #14192A; } a:link { text-decoration:none; color: #BCCACE } a:visited { text-decoration:none; color: #BCCACE } a:hover { text-decoration:none; color: #eeeeee; } body font.highlight { font-weight: bold; font-style: italic; } body font.small { font-size: 85% } body font.big { font-size: 120%; font-weight: bold } ul.banner { padding-left: 0; padding-top: 4px; margin-top: 0; margin-left: 0; top: 0; left: 0; background: url(new_title_bg.gif) black; background-repeat: repeat-x; width: 100%; } ul.navbar { position: absolute; margin-top: 75px; margin-left: 0px; padding-left: 0px; top: 0; left: 0; list-style-type: none; color: #BCCACE; width: 11.5em } ul.navbar li.heading { text-align: center; font-weight: bold; font-style: italic; height: 16px; background: url(new_title_bg2.gif) #17284F; background-repeat: repeat-x; margin: 0px; padding: 0.18em; border-top: 1px solid #17284F; border-left: 1px solid #17284F; border-right: 1px solid #17284F; border-bottom: 1px solid #445372; } ul.navbar li { background: #151D36; margin: 0; padding: 0.18em; border-left: 1px solid #445372; border-right: 1px solid #445372 } ul.navbar li.sub { color: #445372; font-size: 80%; font-style: italic; background: #151D36; margin: 0; border-left: 1px solid #445372; border-right: 1px solid #445372 } ul.navbar li.worldworx { color: #BCCACE; text-align: center; font-size: 80%; background: #151D36; margin: 0; border-left: 1px solid #445372; border-right: 1px solid #445372; border-bottom: 1px solid #445372 } ul.navbar li.bottom { border-left: 1px solid #445372; border-right: 1px solid #445372; border-bottom: 1px solid #445372 } ul.body { float: right; position: absolute; top: 74px; left: 11.5em; right: 0; padding-left: 1em; padding-right: 1em; padding-top: 1em; margin: 0; } ul.body table.news { border: 2px solid #172641; width: 100%; background: black; } ul.body td.head { background: url(head_bg.gif) #151D36; background-repeat: repeat-x; padding-left: 1em; padding-right: 1em; padding-bottom: 0; border-top: 1px solid #303F56; border-left: 1px solid #303F56; border-right: 1px solid #303F56; height: 32px; margin: 0px; top: 0px; bottom: 0px; font-size: 13pt; font-weight: bold; } ul.body td.news { background: #14192A; border: 1px solid #303F56; margin: 1em; padding: 1em; } ul.links { position: absolute; padding-left: 2em; } ul.gamelinks { white-space: nowrap; padding-left: 30em; } Hi, I have hit the "wall" in my knowledge of CSS while trying to implement a "flex-width-equal-height-sidebar-layout" style of layout as a skin/theme for a message board system and need some help. My trouble occurs when a direct link to the post is used (instead of following the menu navigation system) where the top menu information/links area (the area between the banner and the post) is chopped off... The relevant portion of the CSS seems to be the .col_wrap {margin-top: 10px; border: 0; overflow: hidden; float: left; width: 100%; position: relative; z-index: 10; clear: both;} portion of my CSS because if I take out the overflow:hidden declaration then the menu portion of the skin/theme/layout shows correctly but the sidebar the shows the part which should be hidden at the bottom and the footer completely vanishes from view! My apologies but this is the best I can do without having the ability to post pics or urls which could better explain what is wrong and frankly speaking I don't know how anyone here can help given my inability to show the problem but hopefully someone knows or has run into this problem before or can offer some resources that may be of assistance.... i ve been playing with my page and been trying to modify the width of the page (divs) according to the browswer's width. The problem is i want the navigation menu on left to be fixed width (say 200px) and the center div and the right column to be variable width. Also, i want to set a minimum width , so that the floating divs dont roll below the navigation menu. here s the link to the page. try reducing ur browser windows size . the content div rolls down under theleft nav menu. http://ccc.1asphost.com/pacemakerpr...r/cicuitlab.htm Also , i get wierd result in netscape navigator. please help I have an absolutely positioned <div> containing a block of text. I have not specified a width for this <div>. This <div> is nested within another <div> for which I have specified a width of 200px. So something like: html4strict Code: Original - html4strict Code <div style="position: relative; width: 200px;"> <div style="position: absolute; top: 10px; left: 20px; z-index: 100;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur eu purus a tellus mollis consequat. Phasellus aliquam sapien quis mauris. </div> </div> <div style="position: relative; width: 200px;"> Since the absolutely positioned <div> is not part of the page's normal flow, I would expect that its width would expand according to its contents (and the browser window's boundries). Instead, in Firefox only, the width of the absolutely positioned <div> expands only to the width of its parent - in this case 200px. Am I doing something wrong? or is there a workaround for this? I have seen a design which I find pretty interesting where in the main site is aligned left and fixed width at say 700px wide. Yet the footer seems to span the entire screen. The header also seems to use the entire screen width but that is beign accomplished with the background image, but this footer goes all the way to end of the screen and naturally adjusts itself under all the content. Is there a way to get this effect? I'm at the very very very begaining of a table-less design (my first, actually). The problem is, since I have decided to have a non-fixed width, when the browser is minimized, at a certain point the design breaks. See it here (please don't make fun! it's just the start): SiliconSatan.com/test.php I'd like to set a minimum width, probably on the container <div>, so at a certain point it sort of becomes like a fixed width? No smaller than a set width? [EDIT] Also, I have a question about background color mismatch, but it was not quite OT for the CSS forum: http://forums.devshed.com/web-desig...e7t-403266.html Hello, (please also see attached/uploaded style sheet) I'm puzzled why (in the following code) the TEST #2 table renders as required (i.e. 2 rows in 1 column, all with the same cell WIDTH) but the table in TEST #1 seems to render the table cells (i.e. 2 columns in 1 row) without a common cell WIDTH. How can I get all the cells (there are plenty more!) in table TEST #1 to all be exactly the same width (preferably 85px)? Code: <link rel="stylesheet" type="text/css" href="http://thinet/cgi-bin/thinetStyleSheet.css"> TEST #1 <table class="menu" border=1 CELLPADDING=2> <tr> <td class="pinkButtons"><a title="Treats menu" href='http://thinet/theread/forumdisplay.php?s=&forumid=82'>Treats</a></td> <td class="pinkButtons"><a title="New Starters, Leavers and Transfers" href='http://thinet/theread/forumdisplay.php?s=&forumid=41'>Joiners etc.</a></td> </tr> </table> <P> TEST #2 <table class="menu" border=1 CELLPADDING=2> <tr><td class="pinkButtons"><a title="Treats menu" href='http://thinet/theread/forumdisplay.php?s=&forumid=82'>Treats</a></td></tr> <tr><td class="pinkButtons"><a title="New Starters, Leavers and Transfers" href='http://thinet/theread/forumdisplay.php?s=&forumid=41'>Joiners etc.</a></td></tr> </table> I don't think I've quite grasped the idea of CSS yet?!?! Any help/pointers would be appreciated. Thanks, Andy Ok. Here's the problem: I have a asp.net 1.x datagrid inside a floated div and I want the datagrid to stretch the width of the div. This div is in the center of two other floated divs. Is there a way to make a table go 100% the width of its container div? Css code: Code: /* left bar: */ #navBar{ width: 185px; float: left; } /* right bar: */ #rightModulesContainer { width: 130px; margin: 0; padding: 0px 0px 0px 10px; float: right; } /* center content: */ #content{ padding: 0px 5px 0px 0px; margin-top:0; margin-bottom:0; margin-left:4px; margin-right:0px; float: left; text-align:left; /*display: inline;*/ } /* contained in #container: */ #dataGridContainer{ margin: 0; padding-bottom: 10px; min-width:360px; } .categoryGridStyle { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; color: #000000; width:100%; } and here is the layout of the divs: Code: <div id="navBar">left navigation bar here (tree view)</div> <div id="rightModulesContainer">right side bar here</div> <div id="content"><div id="dataGridContainer">datagrid here</div></div> Thanks for your help in advance. I've been messing with this for a while - trying to get it to work cross browser is driving me nuts. I've tried placing the divs in containers and floating the containers, I've tried everything I can think of... I have a header div with a background image - it's basically a pair of hands holding a banner - the arms extending to the sides of the window. I'm trying to work it so that, no matter how wide or thin the window, the arms will always extend to the sides. So when you make it smaller, the image will disappear beyond the viewing window. This happens automatically on the right-hand side, but the image is stopping it on the left. Is there a way to set a min-width, which is smaller then the image itself, so that when the window is shrunk the image starts to disappear on either side until it reaches the min-width? I'm trying to get it so the arms will disappear and stop at the hands. Or can anyone suggest an alternative solution? I tried to do it with background and header image, with the arms on the background, so when the top image moves it looks like the arms move with it. That worked great until I started using a patterned background. Full width: |---------------------------------------| |AAAAAAAAHHH BBBBBBBBBBBBBB HHHAAAAAAAAA| |---------------------------------------| Shrunk width: ------- |------------------------| -------- AAAAAAA |AHHH BBBBBBBBBBBBBB HHHA| AAAAAAAA ------- |------------------------| -------- Grey bit outside window edge. | Window side A Arms H Hands B Banner I hope that makes sense. I expect there's an easy solution but I've been trying to figure it out for several hours and could do with someone else's perspective. Thanks. I have a page with an ASP.NET Gridview on it...this Gridview is located in a child DIV inside a parent DIV. That Gridview can often go wider than the parent DIV width set. In IE6 the MAINDIV (Parent DIV) would expand to fit the expanded Gridview contained within the child DIV. In IE7 the DIV will not expand so it overlaps the DIV and looks bad. I want that MainDiv to dynamically grow with the child DIV width, like it did in IE6. Please see my code below. I want the MainDiv to remain ~800px unless it is pushed out further. Thanks for any ideas on a fix for this. Whenever I try min-width it just blows the parent DIV out to 100% screen size. Code: <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> </head> <body style="width:100%;text-align:center;background-color:#68838B" onload="loadpage();"> <form id="frmMain" runat="server"> <div id="mainDiv" style="position:relative;top:10px;width:800px;height:auto; background-color:white;border:solid 1px #666666"> <div id="contentDiv" style="text-align:left;width:797px; padding:3px 3px 3px 3px;"> <asp:ContentPlaceHolder ID="contentBody" runat="server"></asp:ContentPlaceHolder> </div> </div> </form> </body> </html> I'm writing a modification for a bulletin board. One of the beta testers had a problem with their template... My modification uses a left & right float, with a clearing div at the bottom with a copy right. I know the problem, but my question is, why is it a problem: width="75%" will sometimes, in certain templates, make the right floating table drop down beneath the left floating menu, and it's width is 100%. When I change it to inline styling, style="width: 75%;", it works as it should. I'd really like to know why it's doing this, because I've never ran into this before. Here's a slimmed version of the HTML/CSS: Code: <div id="st0re_wrapper" style="float: left; width: 24%; clear: both;"> <table class="borderwrap iptable" cellpadding="3" cellspacing="2" width="100%"> <tr> <td colspan="" class="maintitle"><p>Your Menu</p></td> </tr> <tr> <td style="padding-left: 5px;" valign="middle"> <div style="margin-left: 5px;"> Sample menu item. </div> </td> </tr> </table> </div> <table class="borderwrap iptable" style="float: right;" cellpadding="3" cellspacing="2" width="75%"> <tr> <td colspan="" class="maintitle"><p>Sample</p></td> </tr> <tr class="row2"> <td valign="top" width="100%"> Sample content. </td> </tr> </table> The used CSS classes a Code: .ipbtable { width: 100%; } table.ipbtable, tr.ipbtable, td.ipbtable { background: transparent; color: #222; font-size: 10px; line-height: 135%; } .ipbtable td, .divpad { padding: 5px; } .borderwrap, .borderwrapm { background: #edede7; border: 1px solid #91908B; color: #55554F; padding: 0px; margin: 0px; } .borderwrapm { margin: 5px; } .borderwrap h3, .maintitle, .maintitlecollapse { background: url(style_images/convention/maintitle.gif); color: #f6f4ef; font-size: 12px; font-weight: bold; margin: -1px; padding: 7px 7px 7px 12px; } .maintitle td { color: #EEEDE8; font-size: 11px; font-weight: bold; vertical-align: bottom; } .maintitlecollapse { border: 1px solid #FFF; } .maintitle p, .maintitlecollapse p, .formsubtitle p { background: transparent !important; border: 0 !important; margin: 0 !important; padding: 0 !important; } st0re_wrapper is just an unused id, besides the inline styling. Code: <tr class='firstrow'> <th width=10%><strong>Rank</strong></th> <th width=40%><strong>Site</strong></th> <th width=25%><strong>In</strong></th> <th width=25%><strong>Out</strong></th> </tr> that makes it exactly the way i want, but when i switch to Code: <tr class='firstrow'> <th style='width=10%'><strong>Rank</strong></th> <th style='width=40%'><strong>Site</strong></th> <th style='width=25%'><strong>In</strong></th> <th style='width=25%'><strong>Out</strong></th> </tr> it is sized naturally. Internet Explorer always presents me with a challenge (partial repost). The current issue involves emulating max-width in IE using the technique described by Svend Tofte. http://www.svendtofte.com/code/max_width_in_ie/ The CSS code uses JavaScript expressions and feeds the browser's width to the style. The CSS code follows. * html #Content { height: 1%; width:expression( document.body.clientWidth > (500/12) * parseInt(document.body.currentStyle.fontSize)? "30em": "auto" ); } This implementation resizes and displays the fluid width in IE. But it does not emulate the max-width property. Basically, I need help fixing the max-width implementation on #Content. Since max-width remains a challenge in IE, the min-width remains a greater mystery. Min-width would be nice as well. The page is complex with several wrappers for other IE display issues and JavaScript functionality. Presently, these workarounds and hacks have my head spinning. The page has an overall wrapper #Container. #Content div has the max-width expression. It encases #div.bgWh, so the page could have true transparent round corners. One issue relates to how div.bgWh expands beyond #Content when the client's browser width approaches 260 pixels. These containers serve a purpose; but IE does not deal with their width in a predictable manner. Fortunately, Firefox does not have these issues. These scenarios leave me scratching my head more often than not. Overflow hidden property has worked for me in the past, but did not provide the magic bullet this time around. Please load the page and shrink you browser to around 260 pixels. Keep your eye on the round corners around the main content area. The container, div.bgWh, expands beyond #Content. Please let me know if you see any relevant patterns and if you have any useful suggestions on implementing max-width. Somebody may suggest better approaches to the IE max-width conundrum. http://neville.f2o.org/nifty_TEMP1.html Styles in Question #Content div.bgWh #Container Hi Guys, Consider the following box: PHP Code: <div style=border: 1mm black Solid; width: 148mm; height: 98mm;'> </div> 148mm + 1mm + 1mm = width of 150mm 98mm + 1mm + 1mm = width of 100mm Now why does neither firefox or ie manage to get it? Firefox is about 2mm out and ie is about 3mm out? Any ideas or is it some quirk? Charlie I am getting a CSS validation error It is: 251 * Parse Error / textarea { border: 1px solid silver; width: 80%; } If I comment the CSS in question out, it gives me another CSS error a little bit farther down in the stylesheet... not sure why it is doing that or how to just fix this validation error, as the ones that come up after it are similar. My end goal is to make the page look normal in FF2. Currently in FF2 some of the text in the purple "Sesame Street" box is blocked out. I didn't create this page, but have been asked to figure out why it looks like this in FF2. I am no CSS expert, but would love to hear from one! Thanks for your help. Hello. I have a section where I have a few floats. For some reason IE 6 is not using the width I'm passing over for the div but IE 7 and firefox are working good. The bot locations should be beside each other along with the address, phone ect. http://www.nessphysiotherapy.com/contact.php Here is a section of the code the has the div CSS. Quote: .twoColFixRtHdr #container2 #mainContent2 #leftContent #ContactInner #ContactILeft { float:left; width:70px; } .twoColFixRtHdr #container2 #mainContent2 #leftContent #ContactInner #ContactIMid { float:left; width:200px; } .twoColFixRtHdr #container2 #mainContent2 #leftContent #ContactInner #ContactIRight { float:left; width:180px; } Suggestions? when i use a (for example) Code: div.top { border-style: solid; border-width: thin; border-color: black; position: absolute height: 20px; top:0px; width:100%; left:0px; right:0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; margin-bottom: 0px; } and then use Code: <div class="top"></div> when i view the page it doesnt go all the way across, it only goes about 90%, and if i change the width to something like 110% where it will go all the way across, if i change my display to a lower/higher setting it is either too long or too short, is there any way to change this and make it "actually" 100%? I have a table with a few rows, and two columns. The content of the left column dynamically changes. I would like to make the left column width be only as wide as the textual content in the column (on a single line - no wrapping). If I leave the column width default auto, the width ends up being wider than it needs to be and the content in the right column ends up being too far away - looks awkward. Is there a way to make it only as wide as the textual content? thanks http://www.crossxp.com View that in FF and IE, you will see my dilema. Also, if you have any other browsers, does it work correctly in them? Ok, so how do I get the main div to be the correct width in IE without it being too wide in FF, or right in FF without being too narrow in IE? Thanks a lot :O. I need to use max-width on the center column of a 3-column layout. This works fine in Netscape 7.0, but I really need it to work in IE 6.0. I found the hack at: http://www.svendtofte.com/code/max_width_in_ie/ but its not working for me. I'd greatly appreciate it if someone could check this mock-up I made: http://www.geocities.com/ninaninety...idthproblem.htm The yellow and red borders are just there as visual aids to show the columns. The yellow center column needs to stop at 36em, yet still be fluid when the browser is resized to less than that. With each variation I try, it either stays at 100%, or "locks" at the 36em and is pushed below the left column. Thanks very much. |