CSS - Css Spacing Prob Driving Me Crazy
Hi guys
Can anyone see why the following has a space under the nav in IE but not in Opera or FF? http://www.mitya.co.uk/cssproblem (CSS: http://www.mitya.co.uk/cssproblem/css/main.css ) I have been playing with it for ages and can't crack it. I've tried removing the clear, etc etc. I'm relatively new to CSS-based design (as opposed to tables) but feel the code and my CSS are OK. Thanks in advance Similar TutorialsI'm TRYING to design a site with CSS, but every browser seems to display CSS differently. How do I do it? How can I make a CSS site that'll render properly in IE6 & 7 and FF, and at 800x600 and 1024x768? This is driving me absolutely bonkers. Look at my site: http://www.firstinsurancefunding.net/ It displays differently in EVERY different browser. WHAT'S THE FIX?? (sorry, I'm frustrated. Could really use some pointers). Hi, I've got a strange problem, which I'm sure the answer to it is simple, but it escapes me at the moment. I have a site we're building at: 209.200.245.223/$sitepreview/quality-edge.com/content.aspx?usertype=2&page=home And as you can see, the background image is cut off (the colour on the left-hand side should be seen to fade out. I had to use min-height to get it to show, but I don't think that I completely understand min-height. Mainly my problem is the footer and the background. I think I've read every footer how-to there is and I can't seem to get anything to work properly. I'm not new to CSS so this is really frustrating me. Any help would be greatly appreciated. Thanks, Steph Hi - I have a small problem with a contact form on my website not working properly and it is driving me crazy, now let me explain. The website works fine in Firefox and Safari, and almost all the pages work fine in IE. The only thing that isn't working is the contact page in IE. The contact page works fine in Firefox and Safari. It's quite tricky to explain to you what I mean really, without showing you. The website is set to a certain width and I have all the margins and paddings correct, as far as I can tell anyway. The contact form is in PHP. The website should be in the middle of the browser at about 900px wide, but when you go to the contact page the PHP code is for some reason making it align to the left, and making the horizontal menu become vertical and out of place. If anyone on here knows about CSS and could take a look for me to see what's gone wrong, I don't think it would take to long, it's just something that I am not aware of or have overlooked in the code. It would be greatly appreciated if you could let me know if you would like to help me out. I'm new to this forum and I did come here looking for help but plan on sticking around so I look forward to meeting you all. Huge thanks if anyone wants to help me, will probably only take a few minutes, I would post the link here but I don't wanna get banned as I am a new member. Hi there.. please have a look here, someone knows how to get rid of the 20px gap between the two black boxes? Hey, so I am a beginner in css and I can't seem to figure out this problem. I am trying to get a td to float: left, and it works just fine on firefox, but IE7 is not showing the float. Here is the code I have for it /* Style for Entries in Category View (Cards View) */ /* -------------------------------------------------------- */ table.sobi2Listing { } table.sobi2Listing td { vertical-align: top; float: left; height: 1%; width: 97%; } /* new */ div.vcard_item { margin: 1px 0px 2px 0; padding: 6px; width: 97%; border:1px solid #dddddd; background-color:#fbfaf2; -moz-border-radius: 5px; The actual page is findawebsitedesigner.info/directory-2.html If you look at the entries, they are all floated perfectly in firefox, but not in IE7. If anybody has the fix to this I would love your help. Hi folks. I'm new to this forum, but I'm not new to CSS. I've inherited a little problem that was left behind by my client's original developer. Here is the code the makes up the header on my page: Code: <body> <div id="issingle"> <div id="container"> <div id="sitename"> <a href="http://www.nectardesign.com"><img src="http://www.nectardesign.com/blog/wp-content/themes/default/nectar-product-development.gif" border="0" alt="Nectar Product Development"/></a> </div> <div id="mainmenu"> <ul> <!--<li class=""><a href="http://www.nectardesign.com/blog">Home</a></li>--> <li class="page_item"><a href="http://www.nectardesign.com/about/">about</a></li> <li class="page_item"><a href="http://www.nectardesign.com/service/">service</a></li> <li class="page_item"><a href="http://www.nectardesign.com/category/all-products">portfolio</a></li> <li class="page_item current_page_item"><a href="http://www.nectardesign.com/blog/">blog</a></li> <li class="page_item"><a href="http://www.nectardesign.com/blog/category/news/">news</a></li> <li class="page_item"><a href="http://www.nectardesign.com/career/">career</a></li> <li class="page_item no_bar"><a href="http://www.nectardesign.com/contact/">contact</a></li> </ul> </div> And here is the css pertaining to that code: Code: body { background:#fff; color:#303030; font: normal 12px /*Verdana,Tahoma,*/Arial, sans-serif; margin:0 auto; padding:0; text-align:center; width:850px; } #container { position: relative; background:url('http://www.nectardesign.com/images/headerbg.jpg') top center repeat-x; color:#303030; border:1px solid #C8C8C8; margin:10px; /* padding:10px;*/ text-align:left; height:598px; } html>body #container {height: 1%; min-height: 598px;} #mainmenu { position: absolute; right: 10px; top: 27px; margin-right: 5px; } #mainmenu li.page_item { float:left; /* height:35px;*/ list-style:none; margin:0; padding:0; } #mainmenu a { border-right:1px solid #b0b0b0; color:#808080; display:block; margin: 0; padding: 1px 8px; text-transform:lowercase; } Basically, this page's header looks correct in Firefox and Safari, but terrible in IE 5.x (Mac). Not only do the horizontal links (About, Service, Portfolio...) not show up correctly--they're actually on the left sidebar--but the repeating image doesn't repeat like it should. It doesn't even show up at all. Since I'm new, please don't hesitate to let me know if I'm forgetting to include any other important info. Thank you!! J Hi All - I've edited the post to try and define my problem a little better. I've also updated the code so it validates. I'm trying to convert a horrendous table layout into CSS. What I need to have is the logo on the left, and the text on the right. The text needs to move with the browser resize - but it needs to stop moving when it gets to be 425px from the left margin. Currently, it keeps moving with the browser but it doesn't stop at the 425px mark. It drops to the bottom, and eventually if you make the window REALLY small, it drops below the logo. I'm sure that I have just got the code all wrong. I guess what I need to know is how do I put a fixed element next to a fluid element and eliminate the drop from happening. What am I missing. This is my current code: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <title>Argh</title> <style type="text/css"> body {margin: 0px; padding: 0; background-color:#ffffff;} #header {height: 80px; width: 100%; background-image: url(icon_bg_grad.gif); background-repeat: no-repeat; background-attachment:fixed;} #nav {clear: both; height: 25px; background-image: url(icon_grad2.gif); background-repeat: repeat-x; } </style> </head> <body> <div id="header"> <div style="width: 425px; float: left;"> <img src="logo.jpg" width="220" height="66" alt="logo"> </div> <div style="float: right;"> <p>This is annoying</p> </div> </div> <div id="nav"> </div> </body> </html> Have a look at this page http://aenui.com/test/hg.html It is exactly the same as the wrapper-free holy grail layout as demonstrated on AListApart (http://www.alistapart.com/d/holygrail/example_4.html), except that I added 2 more divs in the center column. I floated the 2 divs to the left and I expect the 2 divs to start stacking side by side but no, it doesn't do that. Apparently this only happens in the holy grail layout. Does someone have a fix? I'd hate to abandon the otherwise elegant holy grail layout just because of this. Hi, this would be my first post. I've been using CSS for about 6-7 months now, and I always find that IE is difficult. Below is the CSS I am using: Code: * { margin: 0; padding: 0; } body { font-size: 72.5%; font-family: tahoma, sans-serif; background: url(bricks.png) repeat; bakground-attachment: fixed; color: #FEEFA2; } a{ color: white; text-decoration: none; } a:hover{ color: #090; text-decoration: none; } a:visited{ color: #FEEFA2; text-decoration: underline; } p, li { font: 1.2em/1.8em Tahoma, sans-serif; margin-bottom: 10px; } h1 { font: 2.0em Tahoma, sans-serif; color: white; height: 0px; } h2 { font: 1.8em Tahoma, sans-serif; color: #FEEFA2; margin-bottom: 10px; } ul { margin-left: 25px; } img { border: none; } #page-wrap { background: url("bricks.png")repeat #222; background-attachment: fixed; min-width: 720px; max-width: 1260px; margin: 10px auto; } #page-wrap #inside { margin: 0px 0px 0px 0px; padding-top: 10px; padding-bottom: 0px; } #main-content { background: url("") repeat-y #4B4214; padding-left: 230px; padding-right: 230px; padding-top: 20px; border-right: 1px solid #000; width: 45%; margin-left: 10%; } #header { width: 82%; margin: 0% 0% 0% 10%; background: #342E0E; text-align: center; font-size: 1em; } #left-sidebar { width: 150px; float: left; padding-left: 150px; padding-top: 20px; font-size: 1em; } #footer { background: #342E0E; margin-left: 10%; width: 82%; text-align: center; padding-top: 20px; padding-bottom: 20px; color: white; } The problem lies with the left-sidebar div. Here is my HTML: 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" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>MythScape: The Hub for the Paranormal & Mythological</title> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="shortcut icon" href="fav.png"> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style-ie.css" /> <![endif]--> <script type="text/javascript"> function cacherVoir(theDIV){ leStyle = document.getElementById(theDIV).style ; if(leStyle.display == "block") { leStyle.display = "none"; } else{ leStyle.display = "block"; } } </script> <meta name="verify-v1" content="LiYZqvPLQLMOR/3+Stk2cMxWr2l80SisI86GjbuNmLU=" > </head> <body> <div id="page-wrap"> <div id="inside"> <div id="header"> <?php include "button.php"; ?><br/> MythScape -v. 1.5-! </div> <div style="clear:both;"></div> <div id="left-sidebar"> <p> <?php if (!isset($_COOKIE['loggedin'])) { $link_reg = '<a href="user_login.php">Register</a><br/>'; echo("You are not logged in!<br/>"); include "log.php"; echo $link_reg; } else{ $link_logout = '<a href="logou.php">Logout</a><br/>'; $change = '<a href="changepage.php">Change Password</a><br/>'; $mysite_username = $_COOKIE['mysite_username']; echo ("Welcome, $mysite_username. <br/>"); include "access.php"; echo $change; echo $link_logout; } ?> <a href="http://mythscape.freezoka.com/wiki//index.php?MythScapeMainPage" target="_blank">Wiki</a></div> </p> </div> <div id="main-content"> <p>Cryptids, animals that haven't been proven to exist or have little or no information documented on them, could very well be around us. No one can disprove their existence, but there is evidence that can neither support nor destroy the possibility of them being real. Cryptozoology (the study of cryptids) comes from the Greek words: <i>kryptos</i>, <i>zoon</i>, and <i>logos</i>, which translate to: hidden, animal, and discourse. The term was coined by Lucien Blancou when he dedicated a book to Bernard Heuvelmans, "the master of cryptozoology". Accounts of cryptids are abundant and diverse. Even if outsiders to an area have never heard of a cryptid, the native peoples often have tales of them; if the creature never existed, surely they would not have accounts and stories about them.</p> <div style="text-align:right; border-top:1px solid #000;">>>Cryptozoology Main Page</div> <p>Demonology, or the study of demons, is a branch of theology, and involves the studying of demons' existence, or the belief in them. Demons are very common in religion, and are not always evil. In fact, most demons in ancient religions were good, bad, or both. Djinn (Middle Eastern demon-like beings) could become good and adopt Islam. However, in some religions, like Christianity, demons are always evil and serve their lord, Satan.A demonologist studies demons and catalogues their existence; they made be a member of the occult or an exorcist for one of the major religions of today.</p> <div style="text-align:right; border-top:1px solid #000;">>>Demonology Main Page</div> <p>Mythology is the study of myths, which are tales that have been gathered and reflect on a culture's beliefs. Myths were abundant in ancient civilizations like Egypt, Greece, Japan, and Rome, but in the modern world our myths reflect things that aren't religious or spiritual in any way. Tribal mythology is abundant in areas of Pacific Asia or Africa.</p> <div style="text-align:right; border-top:1px solid #000;">>>Mythology Main Page</div> <p> This website is the source of information on all of these topics. It is an unprecedented amalgamation of information that is free for you to read!</p> </div> </div> <div style="clear: both;"></div> <div id="footer"> <p><?php include "footer.php"; ?></p> </div></div> <div style="clear: both;"></div> </div> </body> </html> In Firefox, it's perfectly okay. The Left sidebar nests within the main container and looks gooood. In IE, though, the sidebar jumps in between the header and the maincontainer so that it is in the middle making a huge gap. http://mythscape.freezoka.com If you'd like to see what I'm talking about. Please help PHP Code: body { margin: 0px; font-family: Tahoma; font-size: 10px; background-color: #777; } #bodywrapper { margin-left: auto; margin-right: auto; width: 750px; background-color: #FFF; } #logo { margin-left: 15px; margin-top: 7px; margin-bottom: 7px; } .image { display: block; } .topnav { float: right; margin-top: 25px; background-image: url( images/line.gif ); } #left { float: left; width: 180px; background-color: #ccc; } #right { float: right; width: 180px; background-color: #ccc; } #center { margin-left: 190px; margin-right: 190px; background-color: #ccc; } #clear { clear: both; } #contentwrapper { margin: 0px; } PHP Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv="Content-Language" content="en-us" /> <link href="/css/layout.css" type="text/css" rel="stylesheet" media="all" /> <title>Petroleum Listing Service</title> </head> <body> <div id="bodywrapper"> <div id="header"> <div class="topnav"> image image image </div> <div id="logo"> <img class="image" src="images/logo.gif" /> </div> </div> <div id="contentwrapper"> <div id="left"> left </div> <div id="right"> right </div> <div id="center"> center </div> <div id="clear"></div> </div> <div id="footer"> </div> </div> </body> </html> The problem I am having is it seems that FF starts rendering the white background only once the image is placed...it doesn't count the margin above it as content I assume... IE however does what I want it to do...renders the margin above the image as content, and thus the white background starts at the very top of the page, thus a white margin between the top of the page and the logo. How do I rectify the problem? I understand that FF is probably doing it right...but how do I make FF also start the white background at the top. I was asked to change the header to a rotating one, and I found a nice jquery solution. Of course at first it made the links at the top (on top of the image) disappear, but then I looked at the jquery code and saw that it used z-index (1000), and so I made <header p> = z-index of 6000. That brought them back and in fact it looked pretty good... except in IE. And, depending on what I'm doing to fix the IE problem, Safari. In those browsers, the rotating header appears flush under the header p links, rather than flush up against the border -- and you can see the old static image peeking out. http://esdcar.org/about/board.html?category_id=1&sub_id=2 I googled z-index and IE and found several different options for stacking problems, which it seems like this is. (Am I wrong?) Negative z-index on the header div that contains header p, solved the problem in Safari but not IE. I followed some other suggestion and made all the parent elements successively 1 higher in value. Basically I've tried many things and none have worked. This is the current iteration: Code: #container { color: #775b36; background-color: #ffefca; border: 4px #f5c674 solid; width: 800px; margin: auto; background: url(../images/bkg_faux.jpg) repeat-y 50% 0; z-index: 6003; } <snip (unrelated divs)> #content { width: 75%; position: relative; margin: 0em; float: right; z-index:6002;} #header { background-image: url(../images/ec_landscape.jpg); background-repeat: no-repeat; background-position: top; height: 100px; border-bottom: 4px #f5c674 solid; text-decoration: none; color: #775b36; text-align: left; margin-bottom: 0em; position:relative; z-index:6001; } #header p { float: right; /*margin-right: 1%;*/ margin-top: 0em; padding-top: .2em; font-size: .7em; position:relative; z-index:6000; display:inline; background:#ffefca; padding: 2px; } What am I not getting? It seems like the z-index is the problem that was introduced, but I can't seem to fix it. PROB FIXED hi, I have a site im working on: www.tomaustin.dsl.pipex.com/webdev I have #mainbox on the left and #subnav on the right I want the subnav to have height 100% ( i know it is, but thats to show the other problem) I also have subnav going under mainbox when there is less content in main box basically im trying to get it to look like www.alistapart.com can anyone help, just ask if the probem sisnt make sense thanks PROB FIXED Well I have a multi-part question. I am obviously new to css. I have a site located here . As you can see in the panel to the left the text spans past the footer. I would like the text to push the footer down. I have been trying for hours to get this to work but well.... here I am Any help would be greatly appreciated. Second part is that I opened this in IE on mac and WHOA! Not good to say the least. Any ideas on how I can hack this to match the way it looks in FF? Again any help would be great. Thanks for your time and expertise, phpkata. Hi again. okay i'm playing with CSS to make a new site. Im trying to get the background image to move down from the top of the page by around 3cm or 200px approx but i cant figure out how to do it. Can anyone help a CSS n00b. Thanks Image so you can see what i meean. http://img100.imageshack.us/img100/4571/help2wq.jpg Noted only on certain laptops is a quirk causing the rt floated column (body) to be shifted below the lf float...basically a glitch in the width dimensioning. The first time I noticed it it happened to be one of the wide format DELL laptops using IE thus figuring it had something to do with the non-4x3 ratio. But, I just saw it again yesterday on a run-of-the-mill Compaq. While this instance was noted using IE they also had Netscape installed and it exhibited no crowding problem allowing the webpage to view properly. The following link is directed to a page known to exhibit that quirk on select laptops - http://www.solidgroundnc.com/the_band/bio_band.htm I know trying to use pixel values is a bit on the I-beg-to-be-frustrated side of life. ;-) Using percentages I never achieved my expected results and reducing pixel width to build breathing room was hampered by its cumulative effect on the sub-nav list. I was goaded to use percentages for that list, and I really wanted too, but it never seemed successful. Any insight, if anyone can even duplicate the symptom, would be greatly appreciated. Regards, Golem2 Alright - so I just changed my Java Script based navigation menu over to a CSS based menu for better search engine crawling and easy of use. Here's what I want, and can't seem to do: The original font color of a the links is "white". Easy enough. When you mouse over the link it turns light grey. Looks great! This part works wonders. Here's the problem...When you visit a page in the navigation, the "hover: change color to grey" doesn't work anymore. Instead of remains solid white. Is there a fix/trick to making it work so that always always when you hover over these links they change to grey. Whether the link is active, or already visited, it turns grey during hover. Thank for your help! To see this in action visit Window Film and More.com and take a look at the left navigation. Hi, I need some help with understanding why netscape is rendering list items differently to IE The Embedded (Dreamweaver-wizard-created) style sheet looks like this: Code: <style type="text/css"> <!-- .bul-mnu-lst { font-family: "Trebuchet MS", "Andale Mono", "Arial Unicode MS", "Eras Medium ITC", "Microsoft Sans Serif"; font-size: 80%; line-height: 140%; color: #666666; list-style-position: inside; display: list-item; font-weight: bold; vertical-align: text-top; list-style-image: url(hme_imgs/bullits/dottedArrw_bul.jpg); list-style-type: none; } --> </style> the HTML using the sheet looks like this: Code: <div id="activitiesMnu" style="position:absolute; width:218px; height:186px; z-index:1; left: 17px; top: 227px; visibility: visible;"> <p class="bul-mnu-lst"> football</p> <p class="bul-mnu-lst"> rugby</p> <p class="bul-mnu-lst"> tennis</p> <p class="bul-mnu-lst"> badminton</p> <p class="bul-mnu-lst"> swimming</p> <p class="bul-mnu-lst"> squash</p> <p class="bul-mnu-lst"> volley-ball</p> </div> The problem is, Netscape based browsers are ignoring the, line-height: attribute or just misinterpreting it and using what looks like double spacing between lines. This is causing the layer to overlap other page items and looks aweful. In I.E, it looks as expected. i've tried changing to percentages instead of pixels for the value as heard percentages are best Also tried, list-style-position from 'outside' to 'inside' values and, list-style-image: to non and used a default preset setting (square) bullet-style. - but the problem persists. any suggs?? |