CSS - Ie 6 Issues.....tables, Divs...please Help
Hello folks.
I am normally pretty handy with the CSS. I develop my sites in the latest of Firefox then test in IE 6.0. My latest site looks like gargabe in IE 6. Looks 99.99% perfect in Firefox. Here are the two problems: 1) I can't get the sliced image on the right lined up in IE 6 for the life of me! 2) On the front page, I have 2 tables underneath a paragraph. I don't like tables but for displaying 37 small icons... you get the idea. Anyway when you first go to the home page in IE the tables look okay. But if you navigate away then back, the icons go crazy! Please help! http://www.TattooSeek.info Similar TutorialsThe objective: Produce page content which behaves as if it were 'tabbed' as seen on many websites and programmes. I have done this many times before, but only with absolute positioning from the document base level. This time, the div containing the information to be tabbed has to appear relative (for re-sizability) and contain the tab divs within it. I am using a short javascript to change the z-index of the divs in order to produce the tab effect. The problem: The whole thing works fine, except for: - If I leave the css height off the divs, IE chops the bottom off, and does not allow a scroll. - If I put a height and auto (or scroll) overflow on the divs they display correctly in IE, but disappear in firefox - Until a table contained within one of the divs becomes larger than the stated height. At which point that div (not any of the others) disappears from IE as well. The question: Is this a known bug? If so, what is the work-around? Have I done something dumb? If so, what? The source: source files are available for download (they are quite large, and I don't want to trim them in case something in the trim is the problem. Plus they need to be large to demonstrate the length issue correctly). Text within these examples is copyrighted by various people and is used without permission, for illustrative purposes only. the xhtml page - click through the tabs to see the effect. Add extra rows to the table in the 'dates & prices' tab to see the disappearing problem. the javascript file - the function is at the bottom, 'layer_z_lift'. the css stylesheet - the styles for the tabs are in the middle, commented as tour details tabs. any questions, post and I shall answer. Jz. Ok, so I've learned to stay away from tables when you don't need them, and I have an instance where this is the case. I have a container div that has a header, content and a footer. On my home page, I have to divs next to each other with the same height and a div below them towards the right. To simplify my problem, look at this example. Code: <html> <body> <div style="float:right"> Hello there! </div> <hr> </body> </html> If there's a "float:right" on that div, the hr tag below doesn't get pushed down. But if I use relative positioning and don't use the floats, I can't put the two top divs next to each other. The other option is to use absolute positioning, but again content below doesn't get pushed down correctly. It seems that using "clear:both" works, but it seems weird that this has to be done. For example if I have floating divs in a container, I can get them to stretch out the container like so: Code: <html> <body> <div style="border: 1px solid #000; "> <div style="float:right"> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> Hello there!<br /> </div> <div style="clear: both"></div> </div> <hr> </body> </html> Am I missing something fundamental here? Is there a better solution? Thanks in advance. I cannot figure this out. I've tried adding clear: both in several places, I've tried overflow: hidden and I've tried cursing. Nothing works! How can this be fixed so that in IE6 the divs are not staggered vertically?? Code: <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="38" border="0"></div> <div style="float: right; height: 38px; width: 102px;">copy</a><br>copy</a></div> </div> <div style="height: 38px; margin: 0px; padding: 0px; width: 140px;"> <div style="float: left; height: 38px; width: 38px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="19" border="0"></div> <div style="float: right; height: 38px; width: 102px;"><img style="border: 1px solid #444444; vertical-align: middle" src="http://www.diversifieddesigns.com/GRAPHICS/Spacer.gif" alt="" width="38" height="8" border="0"></div> </div> This is a simplification of my problem, but in general: I have one row in a table whose width is defined by the width of the image in the <td> tag. On the second row, I have two <td>'s and the first one has a width=10 and the second one is supposed to dynamically fill whatever is left between 10px and the width of the image. Unfortunatly, the first <td> on the second row, with a width declared to 10px expands across the entire bottom of just leaving a 1px sliver of the <td>with no width declared. So it looks like this: PHP Code: ----------------- | | | Image | | | ----------------- |________________|| <10px td> <other td> It should look like this: PHP Code: ----------------- | | | Image | | | ----------------- |__|______________| <10px td> <other td> Here is my code: PHP Code: <table> <tr> <td colspan=2><img src="flountt.jpg" style="border: 1px solid #FF0000;"></td> </tr> <tr> <td width=10 height=10 style="border: 1px solid #FF0000;"></td> <td style="border: 1px solid #00FF00;"></td> </tr> </table> Is there an alternative way to use <div>'s and CSS to produce the desired results? Hi - I have been using xhtml coding for most of my web projects this year, thankfully they have been pretty simple. I have a new one, the client has requested it be xhtml compliant. I was not consulted during the design phase, so i have been give the task of programming a very table centric layout. Can all designs be rendered with div's instead of tables? I have a diagram of the structure of a template page and I am not sure how to go about tackling it. Do i start with each individual section? I just need a little push and confimation the below layout is doable in css/divs... Thanks Hi, I'm developing a database driven site in php, which outputs results in a table. The problem I'm having is with styling the table. I need each row to have a thin a bottom-border to seperate them, but when I use tr { bottom-border: 1px solid #dedede; } nothing happens - no border, nothing. I can get the border to appear if I give the tr a display of block, but that breaks the table and it appears like an ordinary div. Is there any way I can use divs to 'fake' a table so it's easier to style. Can I set the main div's display to table and each row div to table-row etc. to get them to display right. The reason I need the table is that the site needs to be uber accessible, so I need screen readers to read the data as it would a table. Can anyone enlighten me? Thanks. Hi, this is my first effort (which will be obvious when you look at it) at using divs and css instead of tables .. http: //pastie.org/935502 Two things that I have been unable to do at the moment are to make the text "Photographs by award winning film sound editor Michael Redbourn" a few pixel lower, and, I tried centering the container that holds the text, "Most pictures are available for sale as Cards, Matted Prints, Laminated Prints, Mounted Prints, Canvas Prints and Framed Prints" by using a spacer but it doesn't display correctly. The two images are here, http: //i42.tinypic.com/kb60q9.jpg and here, http: //i42.tinypic.com/20zqsmr.gif I'm sure you'll know how to replace the adsense banner with a placeholder. Any help with the above two things and also any criticm and hints would be much appreciated. Thanks, Michael Hi Folks, I'm still struggling to make table-less pages - CSS layout is NOT easy at all, even with a good book. This page however has a table for displaying images in amongst text [it's in the Content Management System - I have to work with it]. http://www.johniwhite.com/tests/indextest.html The trouble is: the table is longer than its container DIV at some browser dimensions, so it breaks out of the bottom of it - overlapping it, ALSO: pushing the following DIV out of the way. I don't know either (A): Why the table doesn't just stay in the containing DIV or (B): why the containing DIV doesn't stretch with it. Can anyone help? Thanks John Hey there, I'm pretty new to CSS, but am learning more everyday so bare with me. I recently went over to www.csscreator.com and used their Layout creator to create a page with a header, left column, main column, right column, and footer. This whole thing is to be centered in the browser. That went all well and good, but When I tried to put my main Header and Nav Menu in the Header Div, the entire thing gets garbled up in IE and FF. More specifically, the menu buttons and spacer gifs all become misaligned. Should I go about this some other way or is there anything im just plain missing? Thanks a lot... Newbie warning! I'm new to this forum, and new to CSS and having some trouble with formatting. I was very happy with a menu/submenu system that I am working on, as it displayed as I wanted in IE6. I know that different browsers handle things differently, so I tried it in Opera, and to my suprise.. not what I expected. There seem to be some issues with whitespace between my menus. I have 3 sections that should sit one on top of the other, but whitespace appears between each div. I did read through the posts first, but did not find an answer, though I'm sure its there! I have outlined the problem on this page: http://personal.nbnet.nb.ca/dsnyder The link includes snippets of my CSS and HTML, images of the correct and incorrect results, and a demonstration page. I do have some other questions in regards to highlighting the selected item on the submenu and how create the submenus in one include file if possible. Please take a look .. I'd be very happy to get an answer! Look forward to reading your responses, and the rest of the threads! Hi all, I know there are certain tricks to vertically center texts or images in a div area. And I have read somewhere there are plans to avoid current complexity compared with tables. For example, provided I use same CSS... Code: div,table{ width: 250px; height: 100px; border: 1px solid red; text-align: center; } ...we optain well vertically centered text in this table... Code: <table> <tr><td>this IS vertically centered</td></tr> </table> ...but not in this div based one... Code: <div>this IS NOT vertically centered</div> I ask, do you know an easy way to acomplish the same we get with tables? Thanks! Good day! I have exhausted all of the people I could ask regarding this so I'm hoping I may get help here. This is the first website I've made and it's causing a lot of problems. http:// www . sycwin . com / index2 . html My issue is that my website is browser compatible with everything BUT IE. My problem is getting it to look the same on IE as it currently looks now on Firefox. I understand that there are java script solutions for div stacking problems, but for some reason those are causing no effects problems: 1. subinfo not positioning over mainwrapper and is instead STACKING on top of mainwrapper on IE 2. introduction not in position to the right of carousel/slideshow on IE 3. paints and wires divs are messed up in width, padding and margin on IE here's the css: Code: body { color:#333333; background-color: #f5f5ef; background-image:url(images/bg.jpg); background-repeat:repeat; font-family:Arial, Helvetica, sans-serif; line-height: 18px; font-size:11px; padding:0px; margin:0px; } emphasis { background-color:#e7d018; } strong { color:#2b6934; } a:active, a:link, a:hover, a:visited { border:none; text-decoration:none; } img { border:none; } /*MAIN SEGMENTS*/ #mainwrapper{ width:1000px; margin:0 auto; margin-top:-20px; margin-bottom:-50px; z-index:900; overflow:hidden; } #contentwrapper { width:1000px; margin-bottom:-10px; } #header { background-image:url(images/header.png); background-repeat:no-repeat; height:492px; margin-top:-15px; width:1000px; float:none; } #footer { width:1000px; height:222px; background-image:url(images/footer.png); background-repeat:no-repeat; background-position:bottom; margin-top:-300px; padding-top:-300px; margin:0 auto; } /*SUBINFO*/ #subinfo { width:220px; position:relative; top:0px; right:35px; float:right; z-index:1000; } #blurb { width:220px; height:165px; color:#FFFFFF; background-image:url(images/blurb_01.png); background-repeat:no-repeat; text-align:center; padding-top:380px; padding-bottom:64px; font-size:11px; } .call { font-size:22px; padding-top:20px; font-weight:bold; line-height:20px; } #contact { width:220px; background-image:url(images/blurb_02.png); background-repeat:no-repeat; font-size:14px; line-height:20px; text-align:center; padding-top:5px; } #blurb strong { color:#FFFFFF; } .blurbheader { font-size:20px; font-weight:bold; } .blurbsubtext { font-size:14px; font-weight:bold; } #credits { text-align: center; font-size:9px; line-height:14px; padding-top:80px; } /*CONTENT*/ #content { width:700px; background-image: url(content-bg.png); background-repeat:repeat-y; padding-right:250px; margin-top:-240px; padding-left:44px; } #slideshow { width:460px; padding-left:10px; height:360px; float:left; padding-bottom:20px; overflow:hidden; } #write-up { width:210px; height:360px; padding:8px 0 20px 10px; margin-left:470px; } #products { width:680px; padding-right:10px; margin: 0 auto; margin-top:20px; } #products td { width:160px; padding-bottom:5px; text-align:center; } #products-wires { width:660px; margin: 0 auto; margin-top:20px; } #products-wires td { width:220px; text-align:center; } .product-header { font-family:Gotham, Helvetica, Arial, sans-serif; text-align:left; font-size:25px; font-weight:bold; text-transform:uppercase; letter-spacing:-2px; line-height:14px; } #introduction { width:680px; font-size:11px; line-height: 18px; text-align:left; overflow:hidden; } #paints{ margin-right:18px; width:290px; padding:20px; background-image:url(images/introduction.png); background-repeat:no-repeat; height:195px; float:left; margin-bottom:20px; } #wires { margin-left: 348px; width:290px; padding:20px; margin-right:10px; background-image:url(images/introduction.png); background-repeat:no-repeat; height:195px; margin-bottom:20px; } .product-brand { background-color:#314842; color:#FFFFFF; font-family:Gotham, Helvetica, Arial, sans-serif; font-weight:bold; text-transform:uppercase; text-align:left; letter-spacing:2px; font-size:12px; padding-left:5px; } /*ROLLOVER*/ #preview{ position:absolute; border:1px solid #ccc; background:#333; padding:5px; display:none; color:#fff; text-align:center; z-index:3; } #preview img{ width:300px; height:300px; } /*CAROUSEL*/ #carousel ul { list-style: none; width:3600px; margin: 0; padding: 0; position:relative; padding-left:10px; height:350px; float:left; padding-bottom:20px; } #carousel li { display:inline; float:left; } #carousel { overflow:hidden; I hope you guys could help me figure this one out. I'm absolutely clueless. Thank you for taking the time to read this. I haven't tried this before, so if I'm way off beat, I'll take directions. What I'm trying to do is take a psd file and make a webpage from it. So far, I think I've got the images cut correctly. I tried using divs to begin with, but found I had to apply position:relative to compensate for extra spacing coming after images and divs. I'm placing an image then a div then an image. The spacing between the two are different. I've tried padding:0 and margin:0 just about everywhere I could think of putting it, but that didn't fix it. So, I used RP. But, after getting it to look right in Safari, but not Firefox [just checked before posting here], I found that making the text bigger caused the divs and images to overlap. So, I thought about tables. Yeah, same thing, so I figure I must not know something pretty basic and was wondering if anyone could help. Both pairs of files validate. Here are the links for the: div based layout and it's css file AND table based layout and it's css file Just in case this looks absolutley nuts on other browsers, here is a picture of where I'm trying to get to. I'm feeling a little tortured over this one 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! 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). Centering DIVs inside other DIVs in Firefox? Can it be done in a straight forward way? Setting the inner DIVs float to none seemed to work for IE but not FF. Here's the site in Question: http://www.winchps.vic.edu.au It's a standard fixed width floated DIV columns with a wrapper. One thing it does have is a second DIV inside both columns to display the Gradient background over the top of the repeated background. It works perfect in Firefox & IE7 (with a tweak) but IE6 mkes the sidebar nested div drop below the original sidebar DIV click here for a screenshot for those lucky enough not to have IE6. Here's the CSS code for the basic layout: Code: body { font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; text-align: center; margin: 0px 0px 60px 0px; padding:0px; border: 0; line-height: 2; } #header { width: 802px; } #wrapper { width: 802px; margin:0px; padding: 0px; text-align: left; margin: 0 auto; background: url(images/bodybg.jpg) center repeat-y; } #content { padding: 0px; margin: 0px; } #maingrad { background: url(images/winchcontentgrad.jpg) top left repeat-x; padding: 10px; } #main { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; } #mainstop { width: 589px; float: right; background: url(images/winchcontentbg.jpg) repeat; border-left: solid 1px #000; border-right: solid 1px #000; border-bottom: solid 1px #000; font-size: 10px; } #sidebargrad { background: url(images/winchsidebargrad.jpg) top left repeat-x; padding: 10px 5px 0px 10px; } #sidebar { width: 200px; float: left; background: url(images/winchsidebg.jpg) repeat; line-height: 2; font-size: 14px; border-left: solid 1px #000; border-right: solid 1px #000; } I obviously need to put a conditional comment in there, same for what I did for the minor IE7 tweak, but I'm struggling to suss out what's causing it, I haven't found the specific issue on any of the regular sites (PIE etc). Anyone got any ideas? The Example I've read a bunch about how div's won't stretch to accomidate div's inside of them if they overrun the height/min-height set for the container div. How do I get around this? You can see the skeleton of the site above. It's fine unless you resize the window smaller than the content. Hey, I came across this forum and hopefully somebody can help me. Here is my website: http://www.jmuelectricmotorcycle.tk When the page is in firefox, If you page zoom out, the navbar goes under the content instead of staying on the right. I think it has something to do with padding and the sidebar not having enough room so it drops down. When I set the content to 1005 instead of 1000, it works, but there's a giant 5 pixel gap between my side bar and my content container. Also, does anybody know how to style called data from ssi.php in SMF forums? I want my login boxes to look like my main page. Thanks. Here is my css: Code: html { font: normal 12px verdana, arial; background-color: #000 } body { text-align: center } #fw-container { margin: 0 auto; width: 1000px; text-align: left } .hasSidebar #fw-container { width: 1000px; } a, a:visited { text-decoration: none; } a:hover { text-decoration: underline; } /* --- Header --- */ #fw-head { position: relative; height: 196px; background: #242424; } #fw-title { font: bold 26px verdana; letter-spacing: -1px; position: absolute; top: 20px; left: 20px; padding: 0; margin: 0; z-index: 10; } #fw-title a, #fw-title a:visited, #fw-title a:hover { color: #fff; } .fw-logo { width: 760px; height: 196px; position: absolute; } .hasSidebar .fw-logo { width: 1000px; } /* --- Navigation --- */ #fw-mainnavwrap { background: #242424; padding: 10px 20px; font-family: arial; font-weight: normal; border-top: 1px solid #000; border-bottom: 1px solid #000; } #fw-mainnavwrap ul { margin: 0; padding: 0; background: transparent; list-style-type: none; } #fw-mainnavwrap li { margin: 0px 15px 0px 0px; display: inline; } /* --- Content --- */ #fw-bigcontain { width: 760px; float: left; } .fw-paragraph { background: #242424 url('../Waveform/img/bg-p.gif') repeat-x top left; border-bottom: 1px solid #000; padding: 15px 20px 10px; overflow: hidden; } .fw-title { margin: 0px 0px 10px; font: 18px verdana; color: #fff; } .fw-text { margin-bottom: 10px; } /* --- Sidebar stuff --- */ .hasSidebar #fw-sidebar { width: 239px; float: right; font-size: 12px; clear: right; border-left: 1px solid #000; } #fw-sidebar .fw-title a, #fw-sidebar .fw-title a:visited, #fw-sidebar .fw-title a:hover { color: #fff; text-decoration: none; } #fw-sidebar .fw-title { font-size: 1.3em; font-weight: normal; } /* --- Footer --- */ #fw-footer { font: normal 10px verdana, sans-serif; background: #242424; margin: 0px; padding: 11px 0px 1px; color: #999; clear: both; width: 760px; } .fw-footertext { background: #161616; border-bottom: 1px solid #000; border-top: 1px solid #000; margin: 0px; padding: 6px 0px 6px 20px; } I'm not confident enough with CSS to just use it, so I'm mixing it with some tables too. I want a layout with two tables next to each at the top and then another below. The two at the top are working fine, but the one below keeps jumping back up to the top. I've managed to get an ugly fix by putting in a load of <br> but this doesn't work in IE7 (unless I add a lot more, pushing the content way down in other browsers) and isn't much of a solution. The other problem I have is that I want to have the majority of my page with a white background, but to get a surrounding border I've set the body background to be a colour and then placed a div around all the content. I want this div to be the size of the page and so set it's height to 100%, but this makes it too small. Not sure why. Here is my code for my page and CSS. If anyone can help I'd be most grateful. 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=utf-8" /> <title></title> <link href="incl/default.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function navon(num) { document.getElementById("nav" + num).style.backgroundColor = '#CDEB8B'; document.getElementById("nav" + num).style.paddingTop = '0px' document.getElementById("nav" + num).style.paddingBottom = '0px'; document.getElementById("nav" + num).style.borderTopWidth = '10px'; document.getElementById("nav" + num).style.borderBottomWidth = '10px'; } function navoff(num) { document.getElementById("nav" + num).style.backgroundColor = '#C3D9FF'; document.getElementById("nav" + num).style.paddingTop = '8px' document.getElementById("nav" + num).style.paddingBottom = '8px'; document.getElementById("nav" + num).style.borderTopWidth = '2px'; document.getElementById("nav" + num).style.borderBottomWidth = '2px'; } //--> </script> </head> <body> <div class="main"> <table width="29%" border="0" cellpadding="2" cellspacing="5" align="left"> <tr> <td><img src="" alt="" width="230" height="80" border="0" /></td> </tr> </table> <table width="70%" height="60px" border="0" cellpadding="2" cellspacing="5" align="right"> <tr> <td width="180px" class="nav" id="nav1" onmouseover="navon('1')" onmouseout="navoff('1')">link</td> <td width="180px" class="nav" id="nav2" onmouseover="navon('2')" onmouseout="navoff('2')">link</td> <td width="180px" class="nav" id="nav3" onmouseover="navon('3')" onmouseout="navoff('3')">link</td> <td width="180px" class="nav" id="nav4" onmouseover="navon('4')" onmouseout="navoff('4')">link</td> <td width="180px" class="nav" id="nav5" onmouseover="navon('5')" onmouseout="navoff('5')">link</td> </tr> </table> <br /><br /><br /><br /><br /><br /> <table width="100%" border="0" cellpadding="2" cellspacing="5" align="center"> <tr> <td width="70%"> some content </td> <td width="30%"> some more content </td> </tr> </table> </div> </body> </html> Code: @charset "utf-8"; /* CSS Document */ body { padding-right: 4%; padding-left: 4%; padding-top: 30px; padding-bottom: 30px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; letter-spacing: 0.1em; color: #000000; background-color: #EEEEEE; } a:link { color: #000000; text-decoration: none; } a:visited { color: #000000; text-decoration: none; } a:active { color: #000000; text-decoration: none; } a:hover { color: #000000; text-decoration: underline; } .main { background:#FFFFFF; border: 10px solid #36393D; width: 89%; padding: 5%; } .nav { padding: 8px; background-color: #C3D9FF; vertical-align: middle; text-align: center; font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 24px; color: #36393D; cursor:pointer; border: 2px solid #36393D; } |