CSS - Setting Remaining Width
Ok so I have a logowrap layer which is at 100%.
I have the actual logo set with 'float:right;' with a width of 900px. Now i have a layer just before that with float:left;, but i want to set the width with the remaining space, so all resolutions will render it the same way, whether it be a 1280*760 - or whatever. CSS: Code: #logowrap { width:100%; background-color:#000000; } #logonavtext { float:left; color:#0099FF; padding:2px; } #logonavtext ul { list-style:none; } #logonavtext li { display:inline; margin-right:30px; } #logowrapimg { float:right; width:900px } HTML: Code: <div id="logowrap"> <div id="logonavtext"> <ul> <li>[ I ]</li> <li>[ II ]</li> <li>[ III ]</li> <li>[ IV ]</li> <li>[ V ]</li> <li>[ VI ]</li> <li>[ VII ]</li> <li>[ VIII ]</li> <li>[ IX ]</li> </ul> </div> <div id="logowrapimg"> <?php include('scripts/logorandom.php'); ?> </div> <div class="clear"> </div> </div> Any help would be great. Of course If you have a better way, I would more then welcome it. Similar TutorialsI'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 for some reason when i declare a div as "display: inline", the width is ignored. as soon as i take display: inline out, the width goes to what i set it to. Code: #jobs_list{ background-color: #ffe6c4; padding: 5px; clear: both; overflow: auto; width: 600px; } #jobs_list .heading{ width: 200px; display: inline; } #jobs_list .title{ font-weight: bold; text-align: left; } #jobs_list .company{ text-align: center; } #jobs_list .location{ text-align: right; } <div id="jobs_list"> <div class="heading title">Title</div> <div class="heading company">Company</div> <div class="heading location">location</div> </div> Okay i have been working on this for a while now, and i hate asking for help.. but i have given up on it. Firstly i started using display:inline-block; which meant i could have a width so my hover over menu effect would work. But this did not work in IE7 which means it is useless to what i am doing. So i then moved onto Display:inline; This worked fine, in both IE and Firefox, but the width cannot be set with this value. This value just wraps itself around the content. But i need to set a width to the Inline value. Any help? CSS: Code: #navcontainer ul{ margin: 0; padding: 0; list-style-type: none; text-align: center; } #navcontainer ul li { display: inline; width: 65px; height: 21px; background: url("images/tabbg.gif") 0 0 no-repeat; text-decoration: none; text-align:center; } #navcontainer ul li a{ display:inline; width: 65px; height: 21px; background: url("images/tabbg.gif") 0 0 no-repeat; text-decoration: none; } #navcontainer ul li a:hover{ background-position: -65px 0; color:#FFFFFF; } html: Code: <div id="navcontainer"> <ul> <li><a href="#">Milk</a></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> Also a link to the actual page is http://www.therow2.com/adsense/zzzzzzzzzzzzzzz.php http://tonglebeak.ath.cx/boards/ In firefox, it renders as I expect it to: the caption is half the width of the table, and the caption is centered. In IE, however, it doesn't want to become half the width of the table. Hell, setting a px amount doesn't even affect it. What can be done to fix this in IE? Hi, I'm trying to create horizontal navigation with drop-down menus using strictly CSS. I've followed the tutorial located at: http://www.htmldog.com/articles/suckerfish/dropdowns/ but instead of having text for the main navigation, I'm using a transparent PNG and having text for strictly the drop-down section. To create the background of the navigation, I'm simply changing the background: property since the PNG images are transparent. My problem is that the navigation isn't lining up correctly. It's irratic. Each PNG has absolutely no white space in front of or after it, so it's not that. It simply isn't lining up how it should. I wanted it to be right next to each other and I could simply adjust the width inbetween each one with the margin: property, but I can't get it working. The page can be found he http://serve5.net/xcage/nav/ http://serve5.net/xcage/nav/css/xcage.css Could someone take a look at the source and CSS and try to tell me what I'm doing wrong? If it comes down to it, I'll even pay someone $10 via PayPal to fix the problem and create working code for me - in CSS. Thanks. I'm wondering what's the word is called for setting the image width and height in CSS Code: img.test { <<What's the keyword??>>: 10 px; } Thanks, FletchSOD Hi, there. I've created a simple 2-column list using a <span> to justify items I want in the right column to the right edge of the containing <div>... everything is working fine in Firefox, but have just noticed that Internet Explorer is punching all the spans down one line. I thought spans were purely inline, so this is a little confusing! Here's the CSS I'm using: Code: #300px-LIST { width:300px; margin:0px auto; text-align:left; padding:0; } .right { float: right; } ...and the HTML: Code: <div id="300px-LIST"> LINE 1 LEFT<span class="right">LINE 1 RIGHT</span><br /> LINE 2 LEFT<span class="right">LINE 2 RIGHT</span><br /> LINE 3 LEFT<span class="right">LINE 3 RIGHT</span><br /> </div> Any pointers gratefully received! I am trying to make sure that the body div takes up all the available space in div container (the parent div), however: Code: height: 100%; makes it take up 100% of the whole page, not just the container. Here is my source code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Home -- OpportunIT</title> <link href="main.css" rel="stylesheet" type="text/css" /> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="alternate" type="application/rss+xml" title="OpportunIT News Feed" href="http://www.sphinxgaming.com/OpportunIT/" /> <link rel="shortcut icon" href="favicon.ico" /> </head> <body id="test"> <div id="container" class="rounded-corners"> <div id="header">OpportunIT</div> <div id="nav-menu"><ul> <li><a href="?page=home">Home</a></li> <li><a href="?page=software">Software</a></li> <li><a href="?page=about">About us</a></li> <li><a href="?page=contact">Contact us</a></li> </ul></div> <br/><br/> <div id="body"> Welcome to OpportuneIT!<br/> <br/> <b>What's New:</b><br/> <a href="?page=sinc">SiNC Framework Announced</a><br/> SiNC is a framework used to manage computers and networks in a secure,<br/> reliable, easy to learn and use way. SiNC can make almost any network<br/> management tasks simpler, such as transferring a file over a secure<br/> connection, running commands on or even remotely controlling computers,<br/> checking the status of various servers, computers and online services<br/> automatically, simplifying networked programming tasks and managing network<br/> security.<br/> <br/> <a href="?page=home">Renamed and Redesigned!</a><br/> We have been renamed to OpportuneIT, and are working on a brand new<br/> website... Stay tuned for more info on this.<br/> </div> </div> </body> </html> Code: html, body { height: 95%; } #container { height: 100%; width: 95%; margin-left: auto ; background: #FFFFFF; margin-right: auto ; } #nav-menu ul { list-style: none; padding: 0; margin: 0; } #nav-menu { margin-left: auto ; margin-right: auto ; width:40em } #nav-menu li { float: left; margin: 0 0.15em; } #nav-menu li a { height: 2em; line-height: 2em; float: left; width: 9em; display: block; border: 0.1em solid #dcdce9; color: #0d2474; text-decoration: none; text-align: center; } #body { height:auto; width: auto; margin-left: auto ; background: #FFFFFF; margin-right: auto ; padding: 5px; } #header { margin:0px; padding:0px; background: #000000; width:auto; height:54px; font-family:Verdana; font-size:30px; text-align:center; color:#FFFFFF; border-bottom: #AAAAAA solid 5px; } #footer { margin:0px; padding:0px; background: #000000; width:auto; height:24px; text-align:center; color:#FFFFFF; } .rounded-corners { -moz-border-radius: 20px; -webkit-border-radius: 20px; -khtml-border-radius: 20px; border-radius: 19px; border-style:solid; border-width:20px; } Thanks in advance. This is something I've never been able to figure out a good solution for. I've found a few posts about the same issue, but in more specific terms. Quite often they also speak about how to fill the entire viewport in some way. Anyway. Let's say we have a container: <div id="container"></div> Inside this container we have sort of a caption element. An element that is dynamic in height. Font size, padding, margins and the like will affect how high it gets in the end. <div id="container"><h2>My Dynamic Height caption</h2></div> Now. If i add another "sub container" in there. How do i make it take up the remaining space (height) of the parent container, no matter the size of the parent container and no matter the size of the sibling's dynamic height content (the h2 in this example) <div id="container"> <h2>Caption</h2> <div id="subContainer"> I want this div to be as high as what's left of "container" </div> </div> I know I can do this with javascript, calculating exact dimensions of subContainer based on the current environment. I even have a CSS solution, making "container" position relative and positioning subContainer absolute with left,right,bottom = 0 and top = somewhat close to how high the h2 is. Any other ideas? Hello, I would like to know how to do this: I have a fixed-size div and several inner divs in it, positioned vertically (on top of each other). I want the last div's size to be equal to the size of the fixed-size div minus all the other divs (currently, one other div). Example: I have a form, which has a certain height. The form has a header and a section (div) with 3 inner checkbox divs (columns), and I want the checkbox divs to scroll if they overflow the main div and in effect the parent div. Is there any way to do this? Thanks! EDIT: Here is a live example. (in this example, there's an extra div within the child div holding the checkboxes) Currently, instead of the desired solution each checkbox div is 70% of the height of the main parent. helenas flower abode.com / pictures.php?width=800&height=1118&picturediv_height=366&pngalt=.png&js=1&action=search EDIT2: I changed the structure of the site and the page link as well, and you can't see the temp. fix in Firefox and possibly in IE7 (tested in IE6). EDIT3: Anyone? I'm (noobishly) developing a site and want a menubar of fixed size at the top, with the remaining area of the window filled with a div containing the scrolling content. It's height should be effectively 100% - size of menubar. When I tried 100% height it natually was the full screen height, but then the whole page is full screen height plus the height of the menu bar. Does anyone know how to size a div to meet my needs? Here is the basic structure i'm working with: Quote: <div id="header'> header goes here </div> <br clear="all"> <div id="leftbar">dynamically generated content from php here</div> <div id="map"> map here </div> the styles: Quote: #header{ height:42px; width:100%; background-image: url(../images/header/header_spacer.jpg); background-repeat:repeat-x; text-align:right; } div.leftbar{ float:left; width: 400px; height:100%; overflow: scroll; z-index:1; } div.map{ float:left; } The Problem: In all browsers the height of the leftbar is : 100% of the entire page as opposed to 100% of the entire page minus the size of the header element. This causes a scroll bar to appear on the page. Any ideas on how to solve this problem? If I don't define a height of 100% the leftbar div doesn't scroll at all. A good example of what i'm trying to accomplish here is : maps.google.com . Notice how on that site, the left menu bar scrolls, but is always 100% of the remaining page length (after the search stuff on top). thanks in advance. 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? 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... 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 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> |