CSS - Ff/ie Padding And Border Issue
I'm building a series of navigation links in boxes on top of each other. I want to pad the links inside their div tags 3 pixels all the way around. I'm seperating the boxes using the border property, 1px solid on the bottom of each cell. The top and the bottom are handled in a seperate class.
In firefox, the brower adds the 3 pixels to the overall width (maybe six since I'm padding left/right) so the page comes out like this: --------- | Link 1 | ------------- | Link 2 | ------------- | Link 3 | ------------- Now in IE, it looks correctly. I'm not sure which one is correct, but since IE looks right I assume it's correct. Any way to get the padding to be handled consistently in 2 browsers? Similar TutorialsFirst off, I'm a new member. I'd like to thank everyone for such a great board. My name is Mike and I'll be a very active user in this community as I enter the world of web design. I have a page with an embedded flash object. I created a CSS Border around the object, and would like to add padding to it so that text can wrap around it. I understand that when adding padding to an object, it actually pushes the border out. I want the padding to reflect outside the border and not inside. All of my CSS has to be inline (the company's site does not allow workers to access template files via FTP). Here's what isn't working: <div style="padding-left:10px;padding-bottom:10px;"> <div style="border: 5px solid rgb(198, 175, 144); float: right;position:relative;right:12px;bottom:9px;"> *flash code* </div> </div> As you can see, I tried adding padding-left and padding-bottom outside the border but the text is still going underneath the object. Is there a better solution to this (using inline css)? Thanks to all. I'm having a real hard time trying to figure out how to fix this css issue. I'm trying to fix what's in the 3rd table content that is the compose new pm message form so that it doesn't have any space between the form and the outer content just like it is on the template that says Form with Alternative Style in the form heading. I can't fix the content class rule because that completely messes up the rest of the page and you can see that if you go back to one of the other two tabs. Template: http://www.kansasoutlawwrestling.com/peach/forms.html My Page JSfiddle: http://jsfiddle.net/MtzqR/ I've written a menu in css and I want to show the user what page they are on by having a little block of colour next to the link that they are on. This link should explain it better: http://www.midwivesonline.com/test.html at least it will do in everything but IE6 on windows where it stretches out too far to the right. The problem lies in the css: http://www.midwivesonline.com/styles/test.css In particular: .currentpagep { padding-right: 155px; border-right: 5px solid #85306B; } If I set the padding-right to just 5px then it's perfect in IE6 but screwed up everywhere else. From the tests I've done I don't think that it's a doctype issue - but then again not sure what the solution is... I'd really appreciate any help on this, Cheers, Tim Hi, I have a problem with the css for the following page: http://www.designdictator.com/ For the img in the log i do use the following css: #content img { display : block; border : 1px solid #999; padding : 4px; margin : 20px 0; } but in IE6 the padding between the border and the img doesn't display. Firefox does all right. What's wrong? thanx jarra Hello, is it possible to start a border-left css 1 or 2 pixels from the left of the element instead of it going to the far left of the element?? I am designing a site which has a vertical nave which when an item in the list is hovered over it adds the left and right border and decreases the padding by 5 px: Code: #navlist2 a { width: 168px; /* extend the sensible area to the maximum with IE5 */ display: block; text-align: left; text-decoration: none; color: #fff; margin-top:5px; margin-bottom: 5px; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; font-size: 12px; font-weight: bold; } #navlist2 a:visited { } #navlist2 a:hover { width: 163px; border-left: 5px solid #fff; border-right: 5px solid #fff; padding-left: 5px; } It works fine in firefox, but I noticed that there is massive slowdown/lag . So im wondering, why this is happening in IE and how can I fix it? Hi guys, Ive been playing with this little bit of CSS for a while now and its' definitely getting the better of me. I have been using the demo on www.w3schools.com to create a horizontal menu. That has worked fine. I thought I could use a similar principle to create a horizontal menu. The whole idea is to create a CSS template, and then go through putting the ASP, etc in. I want to have a "leftpanel" on my site which will contain the navigation menu (that I am trying to create) and later make space for featured listings/whatever. Anyway, this is what I have: Code: ul.ver { width: 125px; padding: 0px; margin: 0px; text-align: center; border: 1px solid black; list-style-type: none; float: left; } a.ver { float: left; width: 125px; text-decoration:none; color: black; padding: 0.2em 0.6em; border: 1px solid black; background-color: #A2B5CD; } div.leftpanel { background-color: #CAE1FF; width: 125px; float: left; margin: 0px; padding: 0px; } And the HTML is: Code: <div class="leftpanel"> <ul class="ver"> <li><a class="ver" href="#">MenuA</a></li> <li><a class="ver" href="#">MenuB</a></li> </ul> </div> The problem that I have is that no matter what the width of the <a> tags are, and what the width of the "leftpanel" is, there is always 20-ish pixel width strip of the "leftpanel" showing through, even though they are the same width, with no padding, no margins, no nothing! If I play with the padding on the <a> it seems to have no effect! Thanks to anyone who can offer me some help! Porky. Hi, I just was wondering if there is a way to load an image as background of a div with a 1px padding from the border of that same div. At the moment I have to create two divs. The first div has the border and a padding of 1px and the second div loads the image as background! However I was wondering whether I could do all this in one. Regards, Sim085 Hello. Look at the differences between the borders around photos he http://www.fusionfox.com/2006/02/tinker_toys.html In Firefox and in IE. My CSS looks like this: .imageleft { float:left; margin:10px 10px 10px 0; background:#FFFFFF; padding:3px; border:1px dotted #999999; } Why does the image border disappear in IE? This is killing me. Any help would be greatly appreciated. Thanks! Code on the page: Code: <body> <div class="wrapper_page"> <div class="wrapper_widebackground"> <div class="wrapper_body"> <div class="wrapper_head"><img src="Header.jpg" width="1000" height="182" /></div> <div class="wrapper_nav_top"><!-- navbar goes here --></div> <div class="wrapper_main"> <div class="wrapper_main_insidebackground_blue"> <div class="wrapper_main_insidebackground_white"> <div class="wrapper_main_top"><img src="PageBodyTop.png" width="1000" height="35" /></div> <div class="wrapper_main_content"> <div class="wrapper_main_sword"> <!-- Content here --> </div> </div> </div> </div> </div> </div> </div> </div> </body> Stylesheet: Code: .wrapper_page { text-align: center; width: 100%; border: 0px solid #FFFF00; } .wrapper_widebackground { background-image: url(../Cloth.png); width: 1350px; background-repeat: no-repeat; margin: auto; clear: both; border: 0px solid #FF0000; } .wrapper_body { text-align: left; margin: auto; clear: both; width: 1000px; border: 0px solid #FF00FF; padding: 0px; } .wrapper_head { height: 182px; width: 1000px; border: 0px solid #33FF00; margin: 0px; padding: 0px; } .wrapper_nav_top { height: 24px; width: 1000px; border: 0px solid #FFFF00; margin: 0px; padding: 0px; } .wrapper_main { background-color: #000000; background-image: url(../background.jpg); margin: auto; padding: 0px; background-position: top; background-repeat: repeat; clear: both; border: 0px solid #99FFFF; } .wrapper_main_insidebackground_blue { background-repeat: no-repeat; background-image: url(..Blue.jpg); background-position: top; background-color: #000000; } .wrapper_main_insidebackground_white { background-repeat: repeat-y; background-image: url(..White.png); background-position: top; } .wrapper_main_top { border: 0px solid #00FF00; height: 35px; width: 1000px; margin: 0px; padding: 0px; clear: both; } .wrapper_main_sword { background-image: url(../Sword.png); background-repeat: no-repeat; background-position: right top; vertical-align: top; padding: 0px; margin-top: -14px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border: 0px solid #FF33CC; } .wrapper_main_content { border: 0px solid #FF9900; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 90px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; } Here's the issue. wrapper_main will not stretch all the way to the bottom of the page regardless of the amount of text. It maintains what seems to be a bottom margin whether I put a bottom margin of 0 there or not. (Currently, it is set to auto.) I thought maybe wrapper_body was causing the issue, but setting the padding to 0 on wrapper_body did not work. Here's the confusing part. If I set a border with a width of 1px on wrapper_main, it goes all the way to the bottom. However, the border looks bad on the page so I don't want the border. (I'd give you the URL, but the forums wouldn't allow it.) Why is this happening and how do I remedy it? just read a post on ALA regarding how to create a simple thumbnail gallery using CSS. while the styling of the CSS provided on ALA seems to render the same on both FF and IE, the original code renders slightly different. everything seems to work fine except for the padding around the caption, underneath the image. there is more space around then caption when viewed in IE. please look at this link where the html file and css are hosted - (view source) can you make out anything that could be adjusted to fix this tiny bug? really appreciate if you could help out a little here. been at this for the last couple of days, and now really dead with any ideas to fix this tiny issue :-/ thanx for your time, z Hi all, My CSS for a <DIV> is: Code: .title { width: 350px; background: #aaccff; padding: 0px 0px 0px 10px; border: 1px #cccccc solid; } When I enter text in the DIV, it shows a bit to the right of the left border, which is what padding property is supposed to do! The problem is, in Internet Explorer, this "shift" is PERFECT and there is no extension beyond the right border, but in Firefox, the background color can be seen extended 10px to the right border. I searched on internet and people called it a problem with I.E. Everywhere I visited, people seemed to curse a Microsoft product and give a line of code, "DOCTYPE" etc to force I.E. to change mode and behave like Firefox. Those guys dont understand that what the coder wants is a solution so that Firefox shows the DIV exactly like I.E. 1) So please! Stop cursing I.E. and give solution as to how to modify the code...! 2) A person said that the width is calculated as: width + padding + margin. In my case, since margin is "0", the suggession seemed to use the following code: Code: .title { width: 340px; background: #aaccff; padding: 0px 0px 0px 10px; border: 1px #cccccc solid; } i.e., subtracting the padding-left from width. But that makes "no sense" because if we do the above, it should do nothing but to just change the width of the DIV, and so the end result would be that in Firefox, instead of spanning to 360 px horizontally, this would cause it to span in 350px horizontally. Keeping in view that its the "only" DIV on the page, setting the width parameter should not be a problem. 3) Now, if Firefox follows standard, then how will firefox ever show the padding property correctly if the above scenario is considered...! 4) Microsoft may not follow the standards sometimes, but the result "is" userfriendly most of the times...! Thanks! Please look at the main navigation on this site www.downtowntransmission.com I have it exactly how I want it in IE7 but it is a bit off in FF. Mouseover the Contact link and Gallery Link and you will see what I mean. Is there some small adjustment I can make to make it look the same in both? As a side note, do you like the site? T Take a look at http://actrucking.com/. I just added the orange link towards the middle of the page that says "Get a FREE Online Quote Now!!" I'd like to push it down a bit so it is more centered in the blue area, but I can't seem to get the text to acknowledge margin or padding? Here are what the styles look like: Code: #tlCallBox { background:#336799; height:75px; display:block; float:left; width:868px; margin-left:10px; position:relative; margin-bottom:30px} #tlCallBox h2{ color:white; font-size:19px; margin: 15px 0 0 30px} #tlCallBox p { color:White; margin-left:32px} #tlCallBox b { margin:20px 0 0 120px; font-weight:bold; font-size:20pt} Hi, Im trying to make a simple bar with text in the center. Im having a lot of problems with it however, because its height is 50px not 25px. The bars in question are the ones that say "Description, Payment" etc I started by setting its height to 25px in the CSS but this didnt work. Ive tried adding padding: 0px to what I thought was the relevant tag, but this doesnt change it either! This is the address to the test page: http://www.zombiemod.com/test.html This is the code: 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" xml:lang="en" lang="en"> <head> <meta name="generator" content="HTML Tidy for Linux (vers 6 November 2007), see www.w3.org" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Testing</title> <style type="text/css"> /*<![CDATA[*/ #title { border-top:2px #000000 solid; border-bottom:3px #000000 solid; } #mainNav { margin: 0px; padding: 0px; list-style-image: none; list-style-type: none; float: right; height: 61px; } #mainNav li { float: left; margin-top: 38px; margin-right: 10px; margin-bottom: 0px; margin-left: 0px; } #mainNav li a { margin: 0px; background-attachment: scroll; background-image: url(http://img12.imageshack.us/img12/3157/tabs2d.png); background-repeat: no-repeat; background-position: right 0px; font-weight: normal; color: #efeeee; font-family: Verdana; text-decoration: none; height: auto; width: auto; float: left; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 0px; } #mainNav li a:hover { font-weight: bold; color: #efeeee; } #mainNav li a span { background-attachment: scroll; background-image: url(http://img12.imageshack.us/img12/3157/tabs2d.png); background-repeat: no-repeat; background-position: 0px 0px; display: block; padding-top: 6px; padding-right: 20px; padding-bottom: 0px; padding-left: 30px; height: 19px; width: auto; float: left; cursor: pointer; cursor: hand; margin: 0px; } #horinav li { float:left; width:23%; text-align:center; } p.c13 {text-align: left} span.c12 {color: #efeeee} h3.c11 {color: #000000; font-family: Verdana; text-align: center} div.c10 {text-align: left} table.c9 {border-collapse: collapse} span.c8 {font-family: Verdana; font-size: 80%} p.c7 {font-family: Verdana; font-size: 80%} span.c6 {color: #000000; font-family: Verdana; font-size: 14} p.c5 {text-align: center} span.c4 {font-family: Arial, Helvetica, sans-serif; font-size: 200%} tr.c3 {background-image: url(http://img6.imageshack.us/img6/3518/63387888.jpg)} tr.c14 {background-image: url(http://img6.imageshack.us/img6/2466/bgthin.jpg)} span.c2 {font-family: Arial, Helvetica, sans-serif; font-size: 120%} span.c1 {color: #232323} </style> <style type="text/css"> /*<![CDATA[*/ img.c7 {padding: 5px; border: 1px solid #ffcc00;} tr.c6 {background-color: #000033} td.c5 {background-color: #FFFFFF} tr.c4 {background-color: #FFFFFF} li.c3 {list-style: none} tr.c2 {background-color: #FFEDA3} span.c1 {color: #EFEEEE} /*]]>*/ </style> </head> <body> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" id="title"> <tr class="c3"> <td align="left"><span class="c2"><strong><span class="c1"><a name="top" id="top"><img src="http://img200.imageshack.us/img200/9856/alienware.gif" alt="** PLEASE DESCRIBE THIS IMAGE **" /></a></span></strong></span> <ul id="mainNav"> <li><a href="#Description"><span>Item</span></a></li> <li><a href="#Payment"><span>Payment</span></a></li> <li><a href="#Shipping"><span>Shipping</span></a></li> <li><a href="#Policies"><span>Pictures</span></a></li> </ul> </td> </tr> </table> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr class="c4" valign="top"> <td align="center"> <div class="c10"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="c9"> <tr class="c14 c2"> <td width="100%" colspan="3"> <p class="c5"><strong><span class="c6"><a name="Description" id="Description"><span class="c1">Description</span></a></span></strong></p> </td> </tr> <tr> <td width="49%" align="left" valign="top"> <p class="c7"><br /> Test.</p> </td> <td width="2%" align="right" valign="top"></td> <td valign="top" width="49%"> <ul> <li class="c3"><br /></li> <li><span class="c8">Test</span></li> <li class="c3"><br /></li> </ul> </td> </tr> </table> </div> </td> </tr> <tr class="c14 c2"> <td> <p class="c5"><strong><span class="c6"><a name="Payment" id="Payment"><span class="c1">Payment</span></a></span></strong></p> </td> </tr> <tr class="c6"> <td class="c5" height="2"><br /> <br /> <span class="c8">Test.<br /></span><br /> <br /> <br /></td> </tr> <tr class="c14 c2"> <td> <p class="c5"><strong><span class="c6"><a name="Shipping" id="Shipping"><span class="c12">Shipping</span></a></span></strong></p> </td> </tr> <tr class="c6"> <td class="c5" height="20"><br /> <br /> <span class="c8">Put your Shipping information here.<br /> There are <br> tags here to fill the cell, take them out after inserting you text.</span><br /> <br /> <br /></td> </tr> <tr class="c14 c2"> <td> <p class="c5"><strong><span class="c6"><a name="Policies" id="Policies"><span class="c12">Pictures</span></a></span></strong></p> </td> </tr> <tr class="c6"> <td class="c5" height="20"> <p class="c13"><br /> <br /> <span class="c8"><br /></span></p> <ul id="horinav"> <li><span class="c8"><img class="c7" src="http://img528.imageshack.us/img528/4149/100nw3.png" alt="** PLEASE DESCRIBE THIS IMAGE **" /></span></li> <li><span class="c8"><img class="c7" src="http://img528.imageshack.us/img528/4149/100nw3.png" alt="** PLEASE DESCRIBE THIS IMAGE **" /></span></li> <li><span class="c8"><img class="c7" src="http://img528.imageshack.us/img528/4149/100nw3.png" alt="** PLEASE DESCRIBE THIS IMAGE **" /></span></li> <li><span class="c8"><img class="c7" src="http://img528.imageshack.us/img528/4149/100nw3.png" alt="** PLEASE DESCRIBE THIS IMAGE **" /></span></li> </ul> <br /></td> </tr> </table> </body> </html> Ive put it through a validator, now it validates, but it still doesnt work. I believe the tag in question is c14 and c2. Hi all, I've been reading this forum for a while now, but never had to post anything before. I've hit a snag whilst working on my new personal site. Its all fine in Firefox, I'm using a Wordpress engine to spit out 'posts' which are actually folio items, however IE, after the first one, the second one and every one after that have some extreme margin/padding issue so that the content area is only maybe 20px wide. www dot lucas-starbuck dot com forwardslash design is the site address, any ideas would be much appreciated! Thanks, Lucas Hi there, I am in the process of making a website to purchase tickets for Cannon and Ball's show in Morecambe, and I've tried to make it as standards compliant and usable as possible. I've made a nav bar using a UL tag. This works fine in opera and mozilla, but the hover effect doesn't kick in in IE until you are actually on the text. I've tried using the IE7 patch and that helps none. Can anyone tell me what I'm doing wrong? The site is: http://cannonandball.1stmorecambe.net/ Style sheet: http://cannonandball.1stmorecambe.net/style.css Remove. On the sidebar of this page http://www.laurieannre.com/real-estate-agent.asp the UL titled Neighborhoods has a different padding on FF than in IE and I can not understand why? Hello, I am having an alignment issue that I can't seem to fix. The site is accessed he http://cbo4edu.org/newSite/index.html I've used 2 different CSS files... one for the homepage and one for all the other pages . For the homepage, I want the Mission headline to just touch the blue border from the navigation. Right now when viewed in Firefox on my Mac there is an extra white box above it with nothing in it... but in IE it looks fine. How do I get it to look the same in both browsers? For the other pages, I'm having a similar issue. I want about the same amount of white space above the main headings without the words getting cut off. How can I fix this in both browsers? Thank you in advance. |