CSS - Layout Works In Firefox; Not In Ie!
I'm a pretty new CSS coder, and primarily use Firefox so I designed my website based on that browser, and now when I try opening it in IE it looks completely wrong and different.
Does it have to do with my margins? I have no idea--if someone can just point me in the right direction to even figure out where the problem lies (and even better if you know how to fix it!) that would be fabulous. The website is www.yarniapdx.com and it looks exactly how I want it to in Firefox, but in IE it's a mess! Thank you so much in advance, -lindsey Similar TutorialsI have a three column layout (25%, 50%, 25%) which works fine in IE7 and firefox but not IE6. In IE6 the right column rolls down (would not fit in the space). What would be the best fix for this issue ? Here is my CSS. #main3Column { float: left; width: 50%; } #leftColumn { /* IE7 1px rounding error */ float:left; width:25%; margin-left:-1px; } #rightColumn { float:left; width:25%; } .columnBoxLeft { padding: 0px 0px 0px 6px; margin: 5px 0px 5px 0px; } .columnBoxMiddle { padding: 0px 5px 0px 5px; margin: 5px 0px 5px 0px; } .columnBoxRight { padding: 0px 5px 0px 0px; margin: 5px 0px 5px 0px; } HTML ==== <div id="leftColumn"> <div class="columnBoxLeft"> <h2 class="channeltitle">Left Column</h2> <p>Your Text Here</p> </div> </div> <div id="main3Column"> <div class="columnBoxMiddle"> <h2 class="channeltitle">Main Column</h2> <p>Your Text Here</p> </div> </div> <div id="rightColumn"> <div class="columnBoxRight"> <h2 class="channeltitle">Right Column</h2> <p>Your Text Here</p> </div> </div> My site has three columns. left-middle-right The middle column in IE is right underneath the header as it should be. On firefox the middle coumn is as far below the header as the height of the right column. I have tried everything but i cant get it to look right in both browsers. It is all done with floated divs and doesn't use any tables at all. Please can someone help me! www.datahq-online.co.uk Thank you! www.strutmag.com/newstrut/ I'm working on a site that is using CSS layout. I use a Mac at work and the site looks great on it. I've checked it on the Mac on Safari, IE, and Firefox. When I went home the other day, and I checked the site on my PC (on IE and Firefox), the site did not layout correctly. I think the main issue is the relationship between the left section (where the large image is) and the floated right content box. I was really surprised to see it not working on my PC, so now I'm at a loss. I'm wondering if anyone has any suggestions about about the cross-platform, cross-browser differences I need to account for. Please help! Thanks! CSS My desired layout is working the way I want it to in IE, but not in any other browser. I've been messing with the layout and the CSS for a while now, and I'm officially at a loss. I set the height of the div that the content is in, but when the content were to overflow, I want the background image to repeat. If you enlarge the text a couple of times using Apple + or Alt +, you will see what I mean. Example HTML: <body> <div id="bodycontent"> <div id="content">Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br />Content comes here.<br /><br /></div> <div id="signup">Sign up comes here.</div> <div id="footer">Footer links come here.</div> </div> <div id="coverart"><img src="images/artwork0105.jpg" alt="Strut Magazine Cover Art" border="0" /></div> <div id="topmenu">Menu comes here.</div> </body> CSS: body { font-family: Arial, Helvetica, sans-serif; font-size: 10px; background-color: #FFFFFF; margin: 0px; } #bodycontent { width: 750px; position: absolute; top: 28px; background-image: url(images/bg0105.jpg); background-repeat: repeat; height: auto; } #content { width: 276px; margin-left: 474px; height: 704px; } #topmenu { height: 27px; width: 749px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #000000; border-right-width: 1px; border-right-style: solid; border-right-color: #000000; background-color: #FFFFFF; vertical-align: top; position: absolute; left: 0px; top: 0px; } #signup { color: #FFFFFF; background-color: #000000; text-align: center; width: 750px; height: auto; } #footer { text-align: center; width: 750px; background-color: #FFFFFF; height: auto; } #coverart { height: 704px; width: 474px; position: absolute; top: 28px; } Thanks! Hi, I'm just starting to figure out CSS tableless layouts and I've worked out the following layout with just DIVs and CSS: http://www.webpersona.com/css_test.html Problem is it looks great in Opera, but in IE and Netscape it looks horrid My question is, are my CSS skills so lacking that I've missed something really simple or is this one of those things that require a hack? You'd think something as simple as this would look the same on all 3 browsers, if it is a case where I need to add hacks then I'd have to say CSS layouts have a way to go before they're practical to use. Any feedback would be appreciated I've been working on a layout for my site. It consists of a fixed top menu bar, a fixed left-side menu bar, a fixed right-side bar (possibly used for ads; not sure yet), and a scrollable middle content section. Think a modified Facebook layout. I've been testing with Firefox, and here's what I ended up with (remove the spaces; as a new user, I can't post images, either): htt p://dl.dropbox.com/u/11662651/Graphics/SiteStuff/LayoutGoo d.png That's perfect. It's exactly what I wanted. But then, once I finished it, I tried to test it in IE for compatibility. I almost cried. Almost every aspect of the layout was just completely messed up. Nothing remains fixed when I scroll. Although the menu bar's background color shows it in the right place, all its content shows up below the left-menu instead. In fact, ALL content besides the left-menu shows up below the left-menu instead of in its correct place. And as if that weren't enough, the bullet points on the left-side menu's list (a UL) show up aligned to the left, while the text is aligned to the right (it should be to the right). Besides fonts, not one thing in the layout is correct in IE. But it's all PERFECT in Firefox. I don't usually do this, but because of the scale of how many things are wrong, and because it's only messed up in IE, I'm going to post a download to the .HTML file and ask you to help me figure out what's going on here. So, here's the file (remove the spaces; I'm a new user so I can't post links): htt p:// dl.dropbox.com/u/11662651/Graphics/SiteStuff/index .html?dl=1 Please, please, please, at least get me on the right track to fixing this. And, in related news, I hate IE. Very much. -IMP I have the following CSS that I believe is valid, but it only works in IE. In fact in IE it works perfect, but in FireFox it does not display anything at all. Code: <div style="font-size:8px; text-align:left; background-color:red; width:100px;"><div style="font-size:8px; background-color:green; width:75px;"></div></div> What I am trying to do is display a rating. In the above example, the rating is 75/100, so a green bar 75px long over a red bar 100px long. hi The following CSS code works in Firefox, but not IE. The site has a fixed top bar using CSS which works perfectly in firefox, but stuffs up in IE. Does anyone know what I need to change it to to fix the problem? Code: html, body { margin: 0; padding: 0; height:100%; max-height:100%; font-size: 90%; font-family: verdana, sans-serif, arial, helvetica; background-image: url('images/gradient.jpg'); background-repeat: repeat-x; background-color:#fff; } #header { position: fixed; top: 0px; left: 0px; width: 100%; height: 100px; z-index: 1; height: 50px; margin-bottom: 2em; background-image: url('images/gradient2.jpg'); background-repeat: repeat-x; } #topmenu { position: absolute; left: 250px; top: 30px; width:560px; } #stats { position: absolute; right: 15px; top: 5px; text-align: center; } #gutter { float: left; width: 3%; height: 1px; } #col { float: left; width: 70%; margin-bottom: 1em; padding-right: 3%; margin-top: 5.5em; } #rescol { float: left; width: 94%; margin-bottom: 1em; padding-right: 3%; margin-top: 5.5em; } #rescol a { text-decoration:none; } #rescol td { text-align: center; } #col1 { float: left; width: 45%; margin-bottom: 1em; border-right: 1px solid #ccc; padding-right: 3%; margin-top: 5.5em; } #col2 { float: left; width: 15%; margin-left: 3%; margin-bottom: 1em; padding-right: 3%; margin-top: 5.5em; } #col3 { position: absolute; right: 30px; margin-left: 3%; margin-bottom: 1em; margin-top: 5.5em; } #footer { clear: both; height: 50px; padding: .5em; font-size: 11px; } #footer ul { border-top: 1px solid #ccc; margin: 0; padding: 1em 0 0 0; list-style: none; } #footer li a, #footer li span { display: block; float: left; padding: 5px 1em; border-right: 1px solid #ccc; } #footer li span.copyright { border-right: none; } a:hover { color: #003; } h1 { margin: 0; padding: .5em; } h2 { margin: 0; } hr.c { border: none 0; border-top: 1px solid #ccc; width: 100%; margin-bottom: 10px; text-align: center; height: 1px; } <!--[if IE 6]> body { overflow: hidden; } div.content { height: 100%; overflow: auto; } <![endif]--> I am new to style sheets, and I have been trying to get an entry level position with a web developer here close to me. They sent me a PSD and told me to layout using nothing but CSS and no tables. So I did so... and it looks fantastic in Firefox, but not at all good in IE. The only real problem is with the positioning.. the content color and size and everything seems to be fine.... all the positioning is done in the code on the website, where you can view source... I pasted the CSS code below, but doubtful it will help much. Can anyone offer me some help? The site is he http://www.eomnis.com/test the style sheet is here http://www.eomnis.com/test/css.css and i pasted the style sheet code below. Thanks for any help everyone. Aaron <style type="text/css"> body { background-image: url('images/main_background.jpg'); background-color:#000000; background-repeat: no-repeat; margin: 0px; } .top_text { font-size: 14px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#FFFF00; font-weight:400; } .bold_grey{ font-size:11px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#EEEEEE; font-weight:300; letter-spacing:inherit; } .small_text{ font-size:9px; font-family:Verdana, Arial, Helvetica, sans-serif; color:#EEEEEE; font-weight:300; letter-spacing:inherit; } form { font-family:Verdana, Arial, Helvetica, sans-serif; color:#FFFFFF; font-size:10px; font-weight:300; } .select { font-size:9px; height:15px; } .input { font-size:9px; height:16px; width:160px; } .zip { width: 94px; height:16px; font-size:9px; } .Footer_links{ color:#CCCCCC; font-size:14px; font-weight:300; text-decoration:none; } </style> a site im working on .. (apparently I cant post URLs....) it's the normal stuff at teh beginning with porservices.formapixel and the normal web ending stuff at the end. works fine in Firefox. I validated with transitional. In IE7 the background images for the main divs show up but the entire content and header do not. I thought for some reason it had to do with the z-index. So I removed it from the CSS and changed the .gifs to .pngs that are transparent in the center. It still doesnt work. I'm lost. Quote: #bg { position: absolute; top: 0px; left: 0px; background: #fff url('images/bg.png') no-repeat; width: 747px; height: 264px; } #wrapper { position: relative; width: 747px; margin: 0 auto; background: #fff url('images/abg.png') repeat-y; } that is the css relating to the two images that seem to be blocking everything (that's the only thing I can figure is that those two bg images are just sitting on top of everything.) any suggestions? I can provide the entire css file if necessary just didnt want to post all of that here if i didnt need to. thanks in advance. Ok so I have a page, and The opacity only works in firefox, not IE. This is the code im using img{border:0; filter:alpha(opacity=80); -moz-opacity: 0.80; opacity: 0.80;} img:hover{filter:alpha(opacity=95); -moz-opacity: 0.95; opacity: 0.95;} any ideas? Hello. I am going to change my site to using a CSS file for font color and display and such. I am pretty new at using CSS files with my web site, other that messing with it in modifying my blog skin. I created one I want to use at: http://rhodesfamily.org/style.css, but I can only get it to work with IE. Here is my test page: http://rhodesfamily.org/index_test.htm. It will not display in Firefox, which is my main browser . Your help would be greatly appreciated! Thanks, Carl I'm having a display problem with the following code in Firefox. It works fine in IE. Basically I want the layout to look as close as it does in IE from firefox (I think I'm using the W3C CSS correctly?)... Any suggestions? Code: <?xml version="1.0" encoding="utf-8"?> <!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" xml:lang="en"> <head> <title></title> <style type="text/css"> <!-- body { background-color: #6699CC; } #topBanner { overflow: hidden; width:100%; height:15%; } #contentTable { height: 84%; width: 100%; border:1px solid black; } #leftMenu { background-color: #6695FF; width: 15%; height: 100%; display: block; border: 8px outset #999999; padding: 1px; vertical-align: top; } #contentArea { background-color: #FFFFFF; width: 85%; height: 100%; display: block; vertical-align: top; border: 2px solid #999999; } .menuChildShow { display: yes; } .menuChildHidden { display: none; } --> </style> <script type="text/javascript"> function toggleMenu1(objName) { temp = document.getElementById(objName); if(temp.className == "menuChildShow") { temp.className = "menuChildHidden"; } else { temp.className = "menuChildShow"; temp.style.color = "#00ffff"; } } </script> </head> <body> <div id="topBanner"> <img src="" width="2048" height="75"> </div> <table id="contentTable"> <tr> <td id="leftMenu"> <div id="menuItem1" class="menuParent"> <a onclick="javascript:toggleMenu1('sub1Item1');">Item #1</a> <div id="sub1Item1" class="menuChildHidden"> Item #1 Child 1<br /> Item #1 Child 2<br /> Item #1 Child 3<br /> Item #1 Child 4<br /> </div> </div> <div id="menuItem2" class="menuParent"> <a onclick="javascript:toggleMenu1('sub2Item1');">Item #2</a> <div id="sub2Item1" class="menuChildHidden"> Item #2 Child 1<br /> Item #2 Child 2<br /> Item #2 Child 3<br /> Item #2 Child 4<br /> </div> </div> </td> <td id="contentArea"> Content area </td> </tr> </table> </body> </html> Ok, so i worked a little on this site and i can't get it to work in IE, and its really starting to bug me. What am i doing wrong? http://markspixel.com/smoothtobacco/bio.htm Code: <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <title>Smooth Tobacco</title> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; } img#bg { position:fixed; top:0; left:0; width:100%; height:100%; } #content { position:relative; z-index:1; } .style1 { margin-right: 0px; } </style> <!--[if IE]> <style type="text/css"> html { overflow-y: hidden; } body { overflow-y: auto; } #bg { position:absolute; z-index:-1; } #content { position:static; } </style> <![endif]--> </head> <body> <img src="images/background.jpg" alt="background" id="bg" /> <div id="content"> My content is here </div> Thanks for reading my question. Why do my a:link, a:visited, a:hover, and a:active commands work for IE but not in FireFox? The hover works in both, but the visited only works in IE. I don't have a url for this page yet, so I've put it under my band web page. www.pierced.ca/Kelly/index.htm Try it with IE and you'll see that the visited works. Try it with FireFox and the visited doesn't work. Thanks again, Brad http://www.wam.umd.edu/~gdogum/testing/gdogum/gdogum.html http://www.wam.umd.edu/~gdogum/testing/gdogum/gdogum.css those are my two files, it seems to be working okay in IE6/win but not in firefox... anyone can maybe help me out? thanks it is much apprceiated. edit: also both files validate Hey, Ive used Macromedia Dreamweaver to design the following site. But for some reason the CSS seems to only work in IE. When I view the page in firefox, the CSS doesnt seem to work properly. Ive never encounterd this before, and have run out of ideas. What do you think? Website Here Cheers, Smitch i have 10 div's with abolute positioning and the css is external the html is like this <div class="1"> <div class="2">......... it works in IE but in firefox the images get put all below eachother on the left...except if i put the css inline it works Check out this site (WIP)... the issue specifically is with the Screenshots table... Firefox displays exactly like I would expect it to, screenshots contained within a div, with overflow: auto... looks great in firefox, nicely aligned, no vert. scrollbar... perfect. Now look at it in IE... looks like it is automatically expanding to include ALL 10 screenshots, which stretches the whole page... I've done a little research on this, but I can't find a way to get IE to behave... tried word-wrap: break word (as suggested on another site), but this fails as I'm using images. What makes IE decide to expand the <div> tag automatically. Here's the code pertaining just to the screenshots section. Any help or advice you might give me would be appreciated, I've spent a long time developing the site in css and have only opted to use tables for this particular page... thanks! the CSS: --------------------------------------------------------- .screenshots_table { width: 100%; border: 1px solid #000; backgroung-color: #061840; line-height: 15px; } #screenshots_table_overflow { overflow: auto; padding: 0px; display: block; } --------------------------------------------------------- the html: --------------------------------------------------------- /* --- START SCREENSHOTS CONTAINER --- */ // establish the number of screens in the directory $dir_path = "Game Archive/" . $platform_name . "/". $title . "/Screen Captures/"; $screen_count = count (glob ($dir_path . "screen*.jpg")); echo"<td colspan='5'>"; echo"<table border='0' cellpadding='0' cellspacing='0'>"; echo"<tr>"; /* start screenshots details tab */ echo"<td>"; echo"<table border='0' cellpadding='0' cellspacing='0'>"; echo"<tr>"; echo"<td><img border='0' width='38px' class='display_block'"; echo"src='images/tab_left.jpg'></td>"; echo"<td width='100%' background='images/tab_bg.jpg'></td>"; echo"<td><img border='0' class='display_block' width='70px'"; echo"src='images/tab_screenshots.jpg'></td>"; echo"</tr>"; echo"</table>"; echo"</td>"; /* end screenshots tab */ echo"</tr><tr>"; /* start screenshots */ echo"<td>"; echo"<div id='screenshots_table_overflow'>"; echo"<table width='100%' border='0' class='screenshots_table'"; echo" cellpadding='0' cellspacing='0'>"; echo"<tr>"; // iterate through loop and display linked screenshots as req'd for ($i = 1; $i < $screen_count + 1; $i++) { echo"<td cellspacing='1' valign='top' bgcolor='#04112d'>"; echo "<a href='Game Archive/" . $platform_name . "/" . $title . "/Screen Captures/screen" . $i . ".jpg' rel='lightbox' class='horizontal'><img border='0' class='border' src='Game Archive/" . $platform_name . "/" . $title . "/Screen Captures/small" . $i . ".jpg' /></a>"; echo"</td>"; } echo"</tr>"; echo"</table>"; echo"</div>"; echo"</td>"; /* end screenshots */ echo"</tr></table>"; echo"</td>"; /* --- END SCREENSHOTS CONTAINER --- */ --------------------------------------------------------- It displays fine in firefox, but not in IE. I haven't done anything personally with websites since php was first coming out, so css is completely new to me and Im using a (now modified) template instead of from scratch. So any help would be great. WARNING: Linked site is not work-safe Site is at 'razornow.comlu.com' css code is: Code: body { font-family: tahoma, helvetica, arial, sans-serif; font-size: 10px; text-align: center; background: #000000; margin: 0px; padding: 10px; } html, #wrapper, h1 { margin: 0px; padding: 0px; } img { border: 0px; } #wrapper { margin: auto; text-align: left; width: 710px; position: relative; } h1, h2, h3 { font-size: 10px; } h1 { line-height: 1; position: absolute; top: 0px; left: 0px; } h2 { margin: 0px 0px 5px 0px; padding: 0px; } h3 { padding: 4px 0px 0px 0px; } .block { display: block; } .clear { clear: both; height: 10px; } .left { float: left; margin: 5px 20px 0px 0px; } .right { float: right; margin: 0px 0px 0px 20px; } .readmore { text-align: right; } /* page structure */ #wrapper { background: url(images/body_t.gif) top no-repeat; padding-top: 20px; } #body { background: url(images/body_bg.gif) repeat-y; padding-bottom: 10px; } #body p { background: white; } #nav { position: absolute; top: 25px; left: 253px; width: 450px; height:35px; background: url(images/nav.gif) repeat-x; } #nav ul{ padding: 0px; margin: 0px; list-style-type: square; list-style-position: inside; } #nav li{ padding: 7px 16px 0px 16px; margin: 0px; height:35px; list-style-type: square; list-style-position: inside; float:left; border-right: 1px solid #FFFFFF; display:inline; } .lastchild{border-right: 0px none #FFFFFF !important;} #nav a{ font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; text-transform: capitalize; color: #FFFFFF; text-decoration: none; } #nav a:hover{ color:#fcff85; } #current { float: left; width: 235px; margin-left: 10px; margin-top: -10px; background: url(images/menu_bg.gif) repeat-y; border-bottom: 1px solid #05256b; } * html #current { margin-left: 5px; } #content { float: right; width: 450px; padding-top: 40px; margin-right: 8px; } * html #content { margin-right: 4px; } #footer { background: url(images/body_b.gif) no-repeat; text-align: center; padding-right: 10px; padding-left: 480px; padding-bottom: 30px; } #copyright { position: relative; top: -8px; color: #989898; } /* current column */ #current .nav { margin: 21px 6px 5px 5px; } #current ul { border: 1px solid #8497c2; margin: 0px; padding: 0px; } * html #current ul { padding: 3px 0px; padd\ing: 0px; } #current li { list-style: none; border: 1px solid #4e698f; background: #01285f url(images/harry.gif) left center no-repeat; padding: 0px 0px 0px 20px; margin: 3px; } #current li.readmore { text-align: right; background-image: none; } #current ul a { color: #beddff; text-decoration: none; display: block; padding: 3px 12px 3px 0px; } * html #current ul a { width: 100%; w\idth: auto; } #current ul a:hover { color: white; } #current .readmore { padding: 3px 4px 4px 20px; } * html #current .readmore { padding: 0px 4px 1px 20px; padd\ing: 3px 4px 4px 20px; } #current .readmore a { text-decoration: underline; display: inline; } #currenttitle { position: absolute; left: 15px; top: 409px; } * html #currenttitle { top: 411px; } /* page content */ #content h2 { line-height: 1; margin: 0px; padding: 20px 0px 0px 0px; } #content h3 { margin: 10px 0px; padding: 0px; text-transform: capitalize; } #content p { margin: 10px 0px; padding: 0px; } #content .contentbox { border: 1px solid #e1e1e1; border-top: none; padding: 5px 20px 10px 20px; } * html #content .contentbox { padding-bottom: 11px; } #content, #content a { color: #868686; } #content a:hover { color: #000; } |