CSS - Extra Padding On The Side Bar - Only In Ie
This might be a newbie question.
There is a extra space on the top of the side bar in IE and not in FireFox Probably a browser style issue, however I do not know what to over-write. Example is at the following. holzgreen.com/padding/ Thanks for looking. Similar TutorialsI'm having some troubles getting my div to appear correctly. WHat I want is for the div to be completely contained by a FLASH movie with no whitespace. In Firefox I'm getting an approximately 5px tall white bar at the top. TWH is the url, the flash movie only appears on the main page. My container div uses a background image with a greenish colored 200px left edge, and then a white edge to fill the rest. I know this is what's coming through, but what baffles me is that even when specifying a background color for my div it's not coming through. Here is some of the code: CSS: Code: #container { width: 760px; height: auto; margin: 0 auto; text-align: center; overflow: auto; background: url('../images/style/container_back.jpg') repeat-y; border-bottom: 20px solid #6e868f; } #lcol { width: 200px; height: 380px; float: left; text-align: left; } #nav { height: auto; background-color: #000000; width: 100%; text-align: center; } #nav ul { list-style: none; padding: 20px 0px; margin: 0px; } #nav ul li { padding: 7px; } #info { height: auto; width: 190px; text-align: center; padding: 5px; font-size: 11px; } #flashcontent { width: 560px; height: 380px; padding: 0; margin: 0; float: right; } HTML -- I've taken the content out so that the structure is more clear. Code: <div id="container"> <div id="header"> <div id="logo"></div> <div id="quote"></div> </div> <div id="lcol"> <div id="nav"></div> <div id="info"></div> </div><!--lcol--> <div id="flashcontent"> FLASH player is required to view portions of this site.<br /><br /> <a href="http://www.macromedia.com/go/getflashplayer" target="_blank"> <img src="images/logos/get_flash_player.gif" alt="FLASH player" height="31" width="88" /></a> </div> <script type="text/javascript"> var so = new SWFObject("slideshow.swf", "gallery", "560", "380", "6", "#6e868f"); so.write("flashcontent"); </script> </div><!-- end container --><br /> I am setting up a site that has an inner white content area surrounded by an outer grey area. Both areas have rounded corners. I use a bg image (single image for both corners) with a no repeat to handle the corners on the top. I want the same amount of padding all the way around the white box. So I have a div with the white content area inside the div for the grey box and gave the grey box a padding of 7px. This displays fine in IE (oddly enough), but doesn't display correctly in Firefox or Safari. What it is doing in those 2 browsers is adding extra space on the top and the bottom, so the grey area is about 12px taller than it should on either side. Where is this extra space coming from? How can I fix this? I have attached an image showing the issue and the code used is below. So here's the css: Code: body{ padding:0px; margin:0px; background:#535353; } .nav_container{ width:770px; height:76px; background-color:#FFF; } .page_body{ background:url(images/page_top_curve.gif) top left no-repeat #e1e1e1; width:756px; padding:7px; } .content_container{ background:url(images/content_full_top_curve.gif) top left no-repeat #fff; width:756px; } and here's the HTML: 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>Title</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <!--MAIN NAVIGATION--> <div class="nav_container">hgjgjhg </div> <!--PAGE BODY--> <div class="page_body"> <div class="content_container"> <p>dsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsd</p> <p> </p> <p> </p> <p> </p> <p> </p> </div> </div> </body> </html> Hi all, Wierd problem with Opera. The site's working fine on IE and Firefox: http://3003online.com/demos/piplk/ On Opera, it looks almost the same, except the "bottom links" is pushed WAY down, leaving a lot of white space inbetween it and the upper content (i.e. thats a <div id="bottom_links"> which shows the small links you see at the bottom) If you view the source - there's a "right area" which shows you those four logos at the right of the text content: Code: <div id="right_area"> </div> (CSS) #right_area { width: 109px; float: right; background: blue; height: 260px; margin-top: 140px; background: url(../images/0_sidelogos.gif) no-repeat; } I noticed, when I remove the "height" and "margin-top" properties from the above style, then Opera shows the site correctly - i.e. without that big gap. However, removing the height means I lose the logos... I need that height to show the image 0_sidelogos.gif Any suggestions? One suggestion would be to remove the background 0_sidelogos and insert an <img> tag of that image within the #right_area. Then I wouldn't need to specify height and Opera should display it fine. However I'd ideally leave it as a background - so any advice to the above would be greatly appreciated. Many thanks!! Hi there, someone please help me... i am pulling my hair out! hahah so i am trying to custom code an email template for use in mailchimp - however it looks okay in design preview in dreamweaver but when i preview in firefox or take it into mailchimp there are extra spaces above and below the images not specified in the code. Please help../. urgent job! [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "...."> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Sample Email Template From MailChimp</title> <style type="text/css" media="screen"> /** * @tab Page * @section background color * @tip Choose a color for your HTML email's background. You might choose one to match your company's branding. * @theme page */ body { /*@editable*/ background-color: #ffe4a8; text-align:center; } /** * @tab Page * @section border * @tip Add a border to help your template content stand out from your email's background. */ #layout { /*@editable*/ border: 0px solid #999999; /*@editable*/ background:#ffffff; text-align:left; height: auto; width: 780px; } /** * @tab Header * @section header bar * @tip Choose a set of colors that look good with the colors of your logo image or text header. */ #header { /*@editable*/ background-color: #FFE4A8; /*@editable*/ border-top: 0px none #333333; /*@editable*/ border-bottom: 0px none #ffffff; /*@editable*/ padding: 0px; /*@editable*/ color: #333333; /*@editable*/ font-size: 30px; /*@editable*/ font-family: Georgia; /*@editable*/ font-weight: normal; /*@editable*/ text-align: left; margin: 0px; height: 156px; width: 780px; } /** * @tab Body * @section default text * @tip This is the default text style for the body of your email. * @theme content */ #content { /*@editable*/ font-size: 13px; /*@editable*/ color: #333333; /*@editable*/ font-style: normal; /*@editable*/ font-weight: normal; /*@editable*/ font-family: Helvetica; /*@editable*/ line-height: 1.25em; text-align: justify; padding-right: 30px; padding-bottom: 10px; padding-left: 30px; } /** * @tab Body * @section title style * @tip Titles and headlines in your message body. Make them big and easy to read. * @theme title */ .primary-heading { /*@editable*/ font-size: 28px; /*@editable*/ font-weight: bold; /*@editable*/ color: #532e2a; /*@editable*/ font-family: Georgia; /*@editable*/ line-height: 150%; /*@editable*/ margin: 25px 0 0 0; } /** * @tab Body * @section subtitle style * @tip This is the byline text that appears immediately underneath your titles/headlines. * @theme subtitle */ .secondary-heading { /*@editable*/ font-size: 20px; /*@editable*/ font-weight: bold; /*@editable*/ color: #000000; /*@editable*/ font-style: normal; /*@editable*/ font-family: Georgia; /*@editable*/ margin: 25px 0 5px 0; text-align: justify; } /** * @tab Footer * @section footer * @tip You might give your footer a light background color and separate it with a top border * @theme footer */ #footer { /*@editable*/ background-color: #FFE4A8; /*@editable*/ border-top: 0px none #ffffff; /*@editable*/ padding: 0px; /*@editable*/ font-size: 10px; /*@editable*/ color: #333333; /*@editable*/ line-height: 100%; /*@editable*/ font-family: Verdana; } /** * @tab Footer * @section link style * @tip Specify a color for your footer hyperlinks. * @theme link_footer */ #footer a { /*@editable*/ text-decoration: underline; /*@editable*/ font-weight: normal; } /** * @tab Page * @section link style * @tip Specify a color for all the hyperlinks in your email. * @theme link */ a, a:link, a:visited { /*@editable*/ color: #800000; /*@editable*/ text-decoration: underline; /*@editable*/ font-weight: normal; } a:link { color: #EE770F; } a:visited { color: #C91C00; } a:active { color: #EE770F; } </style> </head> <body> <center> <table id="layout"mc:edit="layout" border="0" cellspacing="0" cellpadding="0" width="780"> <tr> <td id="header" mc:edit="header" width="780" height="156"> <!-- NOTE: This image would trigger the display of a placeholder block with edit links when shown in the MailChimp editor interface --> <img src="...." alt="" width="780" height="129" /> <img src="...." alt="" width="524" height="27" /><img src="...." alt="" width="86" height="27" /><img src="...." alt="" width="101" height="27" /><img src="...." alt="" width="69" height="27" /> </td> </tr> <tr> <td id="content" mc:edit="content"> <h1 class="primary-heading">Primary Heading</h1> <p>Sample copy. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.</p> <h2 class="secondary-heading">Secondary Heading</h2> <p>Sample copy. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo, ipsum sed pharetra gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat. Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.<br /> </p> </td> </tr> <tr> <td id="footer" mc:edit="footer"> <p align="center"> <img src="...." alt="" width="780" height="28" /> <a href="*|ARCHIVE|*" class="adminText"><br /> <br /> view email in browser</a> | <a href="*|UNSUB|*">Unsubscribe</a> *|EMAIL|* | <a href="*|UPDATE_PROFILE|*">Update your profile</a> | <a href="*|FORWARD|*">Forward to a friend </a></p> <p align="center">Copyright (C) 2009 *|LIST:COMPANY|* All rights reserved.<br /> </p> </td> </tr> </table></center> </body> </html> [CODE] conception is offline Reply With Quote Ive been using styles for years now but only in a limited fashion - being very aware of some browsers problems with some of the styles but now I want to dive in head first & create full xhtml pages WITHOUT the use of tables (5 years is enough). Anyway Im playing with setting up a layout using only div tags & I was playing with the margin & padding tags. My question is this: Why does a div set to a width of 100% create a side scrollbar in the browser when any right or left margin value is used? I have also seen the exact same problem with padding when applied to the left or right. Shouldnt the margin or padding be inclusive in the 100% width? What I have ended up having to do is nest a div within a div, setting the inner div's margin (or padding) to some amount & then leaving the padding &/or margins on the outer div set to 0. Its kind of starting to remind me of nesting tables. Am I doing something wrong or is this normal. Ive tested this in Firefox, IE, Mozilla & OPera - all with the same results thanks! I have been trying to write a horizontal CSS nav menu for my website thinkmarriage.org/catalog/ based on some code I found. The menu seems to work great, except: 1. it is adding what looks like 30ish pixels of padding on the left side of the menu. I have tested in FF, IE, and Safari, all do the same thing. The code is CSS 2.1 validated. The link to my sample is: thinkmarriage.org/menu2.html 2. When I add the menu into my actual store, in FF it works, but IE turns the horizontal nav into vertical drop boxes. I was pretty sure the style sheets were conflicting with one another, but now the bar is working in FF, and I can't seem to find any problems. The two style sheets are : #1 (for the menu) : thinkmarriage.org/catalog/menustyle.css and #2 (for the site) : thinkmarriage.org/catalog/stylesheet.css The link to the site is above. If anyone has any thoughts as to where the extra padding is coming from or the conflict with the sheets in IE, I would greatly appreciate it. (Sorry, the rules won't permit me to place hyperlinks) Hello, Interesting problem... I have a span tag with a small font in it. When I don't specify a doctype, there is no red "padding" for lack of a better word. When I specify a strict xhtml doctype, I do get "red padding". I tried setting the padding to zero, but it didn't help. How can I get rid of the "red padding"? Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en"> <table cellspacing="0" cellpadding="0"> <tr> <td style="background: red; padding: 0px;"> <span style="font-size: 50%; background: blue; padding: 0px;"> How can I get rid of the red space? </span> </td> </tr> </table> Thanks! Thanks for taking time to read my question. How do I position 3 pictures beside eachother with no spaces between them? (so they look like one continuous picture) eg: ______ |1|2|3| |_|_|_| instead of ________ |1||2||3| |_||_||_| Thanks, Brad Hi, I'm having a slight problem with my css. I want to display a comment with a number of images to the right of it. e.g "Excellent" plus 5 stars next to it (note: images of stars) so i tried this: Code: <div id = "commentText"> Excellent </div> <div id = "star"> </div> <div id = "star"> </div> <div id = "star"> </div> <div id = "commentText"> Fantastic </div> <div id = "star"> </div> <div id = "star"> </div> <div id = "star"> </div> <div id = "star"> </div> css Code: #commentText { font-size: 100%; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; padding-left: 30px; } #star { display: inline; height: 24px; background-image: url(images/star.png); background-repeat: no-repeat; padding-left: 20px; } I currently have comment with 3 stars displayed underneath it - however they are only half being shown for some reason. Any help is appreciated to help me get the desired effect. Thanks! Hi! I want to have let's say 4 divs of width:25% horizontally side-by-side. Ex: (I'll ry to draw it ) | | | | | | | | | | | | | | | Thank you. Hi. I'm a design student working on a website for my boss, and I've come across a problem and was wondering if someone could help me out. It might be a simple fix, but I can't seem to figure it out. I have a body wrapper div (subtitle, body text, etc) on the left that's approx. 705 px wide and a vertical navigation bar div on the right that's about 240 px wide. I've tried floating the body wrapper left and the navigation buttons right, but one always ends up sitting below the end of the other. When I use the "clear right" or "clear left" commands, it doesn't help. Any ideas what I could do to get them to line up on the top? I want them to sit next to one another. Thank you very much for any ideas! Britta Alright, I run a joomla site and im working on making a 100% tableless xhtml compliant template. I'm very new at this so im trying my best to learn. I used the Lean version of skidoo's layout as the base and then added all the appropriate php tags needed to make it a joomla template. For the one part I need two modules to load right next to each other near the top of the page to mimic the table version of the Latest News and Popular Modules. I'll show you code snipits of how I did it. Code: html: <div id="contentColumn"> <div class="inside"> <!-- middle column content begin --> <p class="blocktext"> <?php mosLoadModules( 'banner', -1 ); ?> </p> <div id="users"> <?php mosLoadModules ( 'user1' ); ?> </div> <div id="users"> <?php mosLoadModules ( 'user2' ); ?> </div> <p> <div id="nofloat"> <?php mosLoadModules ( 'top' ); ?> <?php mosMainBody(); ?> <?php mosLoadModules ( 'bottom' ); ?> </div> css: /*top users */ #users { float:left; width: 300px; } #nofloat { float: none; } So anyways this does indeed put each div tag side by side but my problem is that I need the following PHP code ( <?php mosLoadModules ( 'top' ); ?> <?php mosMainBody(); ?> <?php mosLoadModules ( 'bottom' ); ?>) to return to the next line after the div's, but instead it jumps everything to the right and breaks the template. So I added the nofloat css and that fixed it and put the rest of the content below the side by side div's but now it doesn't work in FireFox. Now I tried padding-top and that worked in both browsers, but its not flexible as the side by side div modules are not always there and I don't want 200px of white space on the pages that don't show it. Also as a side note I tried putting <?php mosLoadModules ( 'user1' ); ?> and user2 into separate div tags that that floated left and right but it had the same outcome, so I stuck with one float left that seems to work the same. My question is what can I do to make this content show after the side by side div's and not beside it in both browsers? You can see what I mean by looking at this test site in both IE 6 and FireFox. http://www.wii-volution.com/testbed/ Thanks for any help you guys can give me! Hi. I've a div container with a gray bg color then inside I've two DIV (left & right). It works on IE but on firefox the bg color the the two DIV is white and if I add bg color=GRAY for the 2 DIV the middle is white. And I don't want to put bg color on the class = left and right because if I want to reuse these with other stuff then the color won't match to other things. How can I fix this problem? Please take a look at the following link with IE & firefox and u know what I mean. Please take a look at source code or in here. Thank you!!! http://yourbestproduct.com/test.html CSS CODE: body { text-align: center; } #container { width: 800px; margin: 0 auto; } #sub_title { background-color: #E6E6E6; background-repeat: repeat; padding: 2px; width: 796px; color: #848484; } .left { float : left; margin-left: 10px; } .right { float : right; margin-right: 10px; } HTML CODE: <div id="container"> <div id="sub_title"> <div class="left">Left Message</div> <div class="right">Right Message</div> </div> </div> So I'm not really new to CSS or HTML though I might as well be considering the last time I did anything in either that had much substance was a class back in high school, about 6 years ago. This is what I want... DIV1 --------------- DIV2 --------------- DIV 3 2 would be in the center with 1 and 3 floating left and right respectively. Instead I'm getting this... DIV1 --- DIV2 ----------------------------------------- DIV 3 or DIV1 DIV2 DIV3 ...I hope you guys get the idea. I'm having trouble figuring it out. My ext CSS sheet, if you care to look, is he http:// livingway.110mb. com/mainstyle.css the frame in question, he http:// livingway.110mb. com/main.htm I'm hoping it'll let you all look at them. It's nothing professional yet because I'm only trying to give an update idea to our "webmaster". Anywho, let me know what I'm doing wrong. My brain hurts right now. i have two divs that are side by side and i want them to have the same height, but i will not know the height ahead of time as the content for at least one of the divs is dynamic (calendar list) and can contain no items up to as many items as there are time intervals in a day. the html for the section in question is Code: <div id="spotlight-wrapper"> <div class="spotlight"> <h3>Currently...</h3> <div id="training" class="spotlight-sub"> <ul> <li><strong>Running</strong> 3mi/4mi/3mi</li> <li><strong>Bench Press</strong> 175lbs</li> <li><strong>Deadlift</strong> 205lbs</li> <li><strong>Squats</strong> 275lbs</li> </ul> </div> <ul class="inline-list"> <li> <a href="http://www.randomhouse.com/features/crichton/airframe/" title="Random House Publishing: Airframe"> <img src="/images/reading.png" alt="Airframe by Michael Crichton" /> </a> </li> <li> <a href="http://www.google.com/musicl?lid=HnJbFL6nobL&aid=lqUKIAaw6tN&sa=X&oi=musiamp;c&ct=result" title="Google Music: Hinder - Extreme Behavior"> <img src="/images/listening.png" alt="Extreme Behavior by Hinder" /> </a> </li> <li> <a href="http://en.wikipedia.org/wiki/300_(film)" title="300 the movie on Wikipedia"> <img src="/images/movie.png" alt="300 - Tonight We Dine In Hell" /> </a> </li> <li> <a href="http://www.fox.com/house/" title="Fox's House M.D. starring Hugh Laurie"> <img src="/images/television.png" alt="House M.D. on Fox" /> </a> </li> </ul> </div> <div class="spotlight"> <h3>In the public...</h3> <div id="calendar"> <ul id="events"> <li> <strong>09/25 20:00 - 09/25 21:00</strong> <br />House MD </li> <li> <strong>09/26 16:00 - 09/26 17:00</strong> <br />Weekly Tempo Run </li> <li> <strong>09/26 17:30 - 09/26 18:30</strong> <br />RPM (Christi) </li> <li> <strong>09/27 06:00 - 09/27 07:30</strong> <br />Weight Training </li> <li> <strong>09/28 06:00 - 09/28 07:30</strong> <br />Weight Training </li> <li> <strong>09/28 08:30 - 09/28 09:30</strong> <br />RPM (Lauren) </li> <li> <strong>09/29 07:30 - 09/29 09:30</strong> <br />Long Run </li> </ul> </div> </div> </div> and my unsuccessful attempt at the necessary css Code: div#spotlight-wrapper { min-height: 317px; } div.spotlight { width: 471px; height: 100%; float: left; margin: 19px 12px 7px 0; background: #373737; overflow: hidden; } div.spotlight h3 { background: #555555; margin: 0; padding: 7px; } here is a live sample Hi Guys, I'm working on a form, and for the life of me, I can't get these divs to sit side by side. You can see the test page at www.details.at/search_test.cfm It's a small form with a few fields and selects I want each element to sit side by side in a single row. Here is the code. I thought display:inline; would do the trick, but it's not working. Code: <style> #control_panel { padding:0 0 1em 2em; width:600px; float:left; } .smalltext { font-family: arial, helvetica, sans-serif; color: #000000; font-size: .7em; } .input { font: .9em Arial, Helvetica, sans-serif; background-color: #FFFFFF; color: #146eb4; border: 1px solid #146eb4; } label { text-align: left; display: block; } div.search_cell { display: inline; } </style> <div id="control_panel"> <form action="http://test.at" METHOD="post"> <div class="search_cell"> <INPUT class="input" NAME="search_box" value="" size="25" maxlength="200"> <label for="search_box"><span class="smalltext">search</span></label> </div> <div class="search_cell"> <select class="input" name="range"> <option value="50">50</option> <option value="Any">Any</option> <option value="1" >1</option> </select> <label for="search_box"><span class="smalltext">within</span></label> </div> <div class="search_cell"> <select class="input" name="range_measure"> <option value="Miles">Miles</option> <option value="kilometers">Kilometers</option> </select> <label for="search_box"><span class="smalltext">range</span></label> </div> <div class="search_cell"> <span class="smalltext">of</span> </div> <div class="search_cell"> <INPUT class="input" value="" type="Text" name="location" size="10"> <label for="location"><span class="smalltext">city & state or postal</span></label> </div> <div class="search_cell"> <INPUT class="input" type="submit" name="Submit" value="Go"> </div> </form> </div> </div> Hello, I have a problem that is making me crazy! I have a simple page with some news on it. Every news is a <div> and contains two floating blocks: Image(floating left) and the text(also floating left). These blocks must stay side by side and NOT one over the other. The width of the news <div> can be 500-550px max for layout reasons. If the text is longer than the space available Firefox moves the entire text block under the image, while IE resize correctly the text block. I have tried to apply diplay:inline; to both blocks with no effect. Here is the test page Link (I have limited the width to 500px to simulate the real layout.) CSS: Code: .news { float: left; clear:left; margin: 0 0 1em 0; width: 100%; } .img_hl { float:left; margin-right: 10px; } .newstext { padding-top: 1em; float:left; } Please help me!! -- Bye Redhawk I've been having some issues getting a design for a site I'm co-authoring to display correctly using CSS. I know that what I'm trying to do should be possible, but I haven't been able to figure it out and am getting pretty damn frustrated with the whole thing. I could probably do it with tables, and right now I have it set up with some javascript that I threw together, but css+divs would be the ideal solution. Anyways, this is basically what I want to try and do (that's the javascript version). Just resize the window a bit to see what i'm getting at. Here's the source: 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>Title</title> <style type="text/css"> <!-- #leftpane { float: left; height: 100%; border: 1px solid black; } #rightpane { float: right; height: 100%; border: 1px solid black; } --> </style> <script type="text/javascript"> <!-- // get rid of all this javascript and figure out a way to do this with css var windowWidth = 800; window.onload = function() { getWindowSize(); resizeLeftPane(); } window.onresize = function() { getWindowSize(); resizeLeftPane(); } function getWindowSize() { if(window.innerWidth) { windowWidth = window.innerWidth; } else if(document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; } else if(document.body.clientWidth) { windowWidth = document.body.clientWidth; } } function resizeLeftPane() { var rightpaneWidth = document.getElementById('rightpane').offsetWidth; var margin = 10; document.getElementById('leftpane').style.width = String(windowWidth - rightpaneWidth - margin * 3) +'px'; } //--> </script> </head> <body> <div id="leftpane"> <p>this pane needs to stretch as wide as it can while leaving room for the image at right, whose width is arbitrary</p> </div> <div id="rightpane"> <img src="http://movingboxstudios.com/testz0rz/images/box.jpg" height="100%" alt="image" /> </div> </body> </html> Basically I need a way to have 2 elements next to eachother, 1 of which is an arbitrary size and the other be wide enough to fill the rest of the containing block. Any help would be much appreciated. EDIT: Here's a link to the actual working design, maybe that'll help in understanding my question (don't open it in IE unless you want a facefull of ugly). Hey guys! Usually if you make a table and then make another table, the other table will be located below the table before. I want them to be side by side. So I tried this CSS value : table { display : inline; } then it worked, but the problem is, that if the tables have different sizes, the smaller one is not aligned to the top and looks smaller than the table before it. I want them all to be aligned to the top. I tried vertical-align:top and valign="top", but they still don't work... Is there any other way to make tables have no line breaks before and after the table? Is there any other property that controls the line breaks of the table? I tried display:table-cell , but the problem is still the same. thanks |