CSS - <th Width=10%> -> <th Style='width=10%'> Not Same???
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. Similar TutorialsI've been working on a CSS style for a web site, and I've got a small issue with the right hand column not staying within the bounds of the screen. When using a tool to see where the div's borders the right is about 200 px going off the right of the screen, making the screen horizontally scrolling. I am not a CSS expert. I know enough to get around, but this I don't understand. (I might have posted too much, but I figured if someone needed something more, it's already all there.) Thanks for any assistance that can be provided. HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Experience Inc. - Warren and Forest Counties Office of Aging</title> <link href="css/grey_style.css" rel="stylesheet" type="text/css"> </head> <body> <div id="header"> <span style="float:left;"> <img src="images/logo.gif" /> </span> <span style="float:right;"> <div style="text-align:center"> <div id="outerFirst"><a href="index.php"><span>Home</span></a></div> <div id="outerFirst"><a href="index.php"><span>Services</span></a></div> <div id="outerFirst"><a href="index.php"><span>Senior Centers</span></a></div> <div id="outerFirst"><a href="index.php"><span>Calendar / Menu</span></a></div> <div id="outerFirst"><a href="index.php"><span>Trips / Events</span></a></div> <div id="outerFirst"><a href="index.php"><span>About / Contact</span></a></div> </div> </span> </div> <div class="CellBackGround"> <table width="100%"> <tr> <td> </td> </tr> </table> </div> <div id="pictureContainer"> <div id="largeHomeText"> Warren and Forest Counties Area Agency on Aging </div> <div class="together"> <img src="images/home_image_bar/image1.jpg" /> <img src="images/home_image_bar/image2.jpg" /> <img src="images/home_image_bar/image1.jpg" /> </div> </div> <div class="CellBackGround"> </div> <div id="wrapper"> <div id="content"> </div> </div> <div id="navigation"> <p> </p> </div> <div id="extra"> </div> <div id="footer"> <p>This is the footer area. </p> </div> </body> </html> CSS Code: body { font-family: "Times New Roman", Times, serif; font-size: 12pt; font-style: normal; font-weight: normal; color:#FFFFFF; background-color:#666666; margin-left:0; margin-top:0; margin-right:0; } #header { width: 100%; background-color: #666666; overflow:auto; vertical-align:top; height:auto; } #menu { height: 54px; margin: 3em 0; padding:0 1em; border-bottom: 0px solid black; overflow:inherit; } #outerFirst { float: left; width: 90px; height: 130px; margin: 0 0px 0 0; background: url( '../images/greyFirst.gif' ) 0 -50px no-repeat; } #outerFirst a { cursor: pointer; display: block; margin: 0; padding:0; width:90px; height:54px; overflow:hidden; font-family: Arial; font-size:0.7em; font-weight:normal; color:#FFFFFF; text-decoration: none; background: url( '../images/greyFirst.gif' ) top left no-repeat; } #outerFirst span { height: 54px; display: block; margin:0; padding: 25px 0px 0px 0px; } #outerFirst a:hover { width:90px; height:54px; background: url( '../images/greyFirstRoll.gif' ) top left no-repeat; color: yellow; } #outerFirst a:active { background: url( '../images/greyFirstRoll.gif' ) top left no-repeat; } .CellBackGround { height:2px; background: url('../images/redPixel.gif') center center; } .CellBack2 { background: url('../images/redPixel.gif') center center; } #pictureContainer { width:100%; background-color:#666666; overflow:auto; height:95px; } #largeHomeText { color:#999999; font-size:13pt; float:left; padding-top:74px; padding-left:3px; } .together img { padding: 0; margin: 0; border: 0; display: inline; float: right; overflow:hidden; } #mainTextContaner { color:#660000; margin-left:-5px; } #footer { color:#666666; } /* This code is straight from http://www.webcredible.co.uk/user-friendly-resources/css/css-round-corners-boxes.shtml */ .bl {background: url(../images/bl.gif) 0 100% no-repeat #FFFFFF; width: 45%;} .br {background: url(../images/br.gif) 100% 100% no-repeat} .tl {background: url(../images/tl.gif) 0 0 no-repeat} .tr {background: url(../images/tr.gif) 100% 0 no-repeat; padding:10px} .clear {font-size: 1px; height: 1px} /* This code is straight from http://www.webcredible.co.uk/user-friendly-resources/css/css-round-corners-boxes.shtml */ .bl2 {background: url(../images/bl.gif) 0 100% no-repeat #FFFFFF; width: 35%;} .br2 {background: url(../images/br.gif) 100% 100% no-repeat} .tl2 {background: url(../images/tl.gif) 0 0 no-repeat} .tr2 {background: url(../images/tr.gif) 100% 0 no-repeat; padding:10px} a:link { font-size: 14pt; color:#999999; } a:hover { font-size: 14pt; color:#660000; } a:visited { font-size: 14pt; color:#999999; } #news { background: url(../images/news.jpg) 100% 0 no-repeat; width:370px; height:600; } div#wrapper{ float:right; margin-right:-30%; width:99%; } div#content{ margin-right:30%; border-left:2px solid #FFFFFF; border-left-color:#660000; padding-left:10px; padding-right:10px; height:400px; padding-top:10px; } div#navigation{ float:left; width:32.9%; padding-top:10px; } div#extra{ float:left; clear:left; width:32.9%; padding-top:10px; } p{ margin:0 10px 10px } div#footer{ clear:both; border-top:2px solid; border-top-color:#660000; border-bottom:2px solid; border-bottom-color:#660000; text-align:left; color:#FFFFFF; } div#footer p{ margin:0; padding:5px 10px; width:10%; } 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? 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 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 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 have designed one page. I am getting correct behavior in IE but there is some problem with Mozilla. Here is the code sample: <DIV class=ColumnHeader><SPAN class=noSort style="WIDTH: 6%; TEXT-ALIGN: center"><input type=checkbox id=chkSelAllAvail value="" name=chkSelAllAvail></SPAN> <SPAN style="WIDTH: 20%">Year</SPAN> <SPAN style="WIDTH:36%">Type of Report</SPAN> <SPAN style="WIDTH:24%">End Date</SPAN></DIV> I have attached both screen shots of IE and Mozilla. Can anyone help me ?? 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 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. 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 Hi All, Very quick question regarding min-width and max-width for divs. In Firefox, Safari, Chrome all is well... however in IE6+ the DIV is 100% of the screen rather than the specified 800px. I would really appreciated a few tips to sort this out. Much appreciated. Hi, I just can not really understand what the min-width and max-width properties do. Basically I am following some of the w3c tutorials and went to this link: http://www.w3schools.com/css/tryit.asp?filename=trycss_dim_max-width I edit the min-width property to 1000px, reduced the size of my browser, however the text inside the p tag still wraps! I tried to also set all p tags as float, but nothing! Can someone please better explain to me what the min-width and max-width actually do and how and when to use them? Thanks and Regards, Sim085 I have an issue. The issue is that if I set a div at 100% wide with a background color or image then everything works fine upon page load. If i shrink my window in width it still works. If I shrink my window to the point where there is a scrollbar at the bottom then I get an issue when I scroll to the far right. My 100% background is not 100% anymore. It makes sense to me that it's 100% of the loaded window. What I don't understand is what could be the workaround on something like that. Any thoughts? 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? Hi, I read some interesting news today - finally Microsoft is admitting that IE7 is just not what it's cut out to be - took them a while to work that one out. So, whilst they're still sorting out their big bungle, I need to sort out all those IE7 errors. Anyone know how to get the width of a <h> tag to stretch the width of the <div> it is contained within? I don't want to used a fixed with, but want to use a fluid width %. IE7 can't seem to handle that. I have: The CSS Code: #content { float: left; width: 60%; border:1px solid #EFEFEF; margin:10px 2.5%; } #content h2 { margin:0px; padding-top:5px; background:url(images/bg_mainMenu.gif) repeat-x bottom; width:100%; height:26px; } #content span.breadcrumb { padding-left:15px; } The html: Code: <div id="content"> <h2><span class="breadcrumb">There is some text in here</span></h2> </div> Of course it works in FF, but with IE7 (haven't even started to look at IE6!) the width of the <h2> stretches only to the width of the text contained within. It works in IE if I use a fixed width. Anyone have a solution to beat this monster some attempt to call a browser? Thanks Hey guys, I need help getting rid of this gap on my project. My plan is that I will be nesting a couple different divs inside of the one below. I've tried margin, padding, everything. It has this gap in Chrome, IE, and Firefox. Code: #header { width: 100%; height: 220px; background-image: url(images/header/tile.jpg); background-repeat: repeat-x; background-position: top left; } It does however work when I set the body background image to the one above, but the only downside to that, is that I wanted to have a separate image for the body. TIA guys. |