CSS - Img Border Padding In Ie6 Problem
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 Similar TutorialsI'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 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. First 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'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? 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?? 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! 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, 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 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? Hi. Have created some simple tabs using table cells. Active tab should have bottom-border color equal to page background-color. Non-active tabs should have bottom-border=black. Works fine in IE, but does not work very well in Firefox. If I remove the border-collapse:collapse on the table, then firefox also work... but I would like to be able to keep the 1px border between each table cell. So is there a way to make this work in both IE and Firefox... and hopefully most other browsers... See code below: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html> <head> <style type="text/css"> a.menu_top:link {color: #000000; text-decoration: none;} a.menu_top:visited {color: #000000; text-decoration: none;} a.menu_top:hover {color: #000000; text-decoration: none;} a.menu_top:active {color: #000000; text-decoration: none;} td.menu_top_passive { background-color: #777; border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid; border-bottom: 1px #000000 solid; text-align: center; cursor:pointer; font-weight: bold; padding: 5px 20px 5px 20px; margin: 0; } td.menu_top_active { background-color: #bbb; border-left: 1px #000000 solid; border-right: 1px #000000 solid; border-top: 1px #000000 solid; border-bottom: 1px #bbb solid; text-align: center; cursor:pointer; font-weight: bold; padding: 5px 20px 5px 20px; margin: 0; } </style> <script language="JavaScript"> function change(id, url) { for (i=1; i<6; i++){ eval("document.getElementById("+i+").className='menu_top_passive'"); } eval("document.getElementById("+id+").className='menu_top_active'"); } </script> </head> <body style="margin:0; padding:0; background-color:#bbb;"> <br><br> <center> 1. Load the page.<br> 2. Click Item 4.<br> 3. Click Item 2.<br><br> Why is the bottom border of the menuelements (table cells) not getting correct in Firefox?<br> None-active menuelements should have a border-bottom = black, active should have same bottom-border as page.<br> Notice that I use border-collapse on the table in order to get the cell-border 1px thick between the menuitems.<br> If I remove border-collapse, then there is no strange behaviour in Firefox.<br> Any way to get this working in Firefox without breaking it in IE? </center> <br><br><br> <table border="0" cellpadding="0" cellspacing="0" align="center" style="border-collapse:collapse;"> <tr> <td id="1" nowrap class="menu_top_active" onClick="change('1');"><a href="javascript:;" class="menu_top">Item 1</a></td> <td id="2" nowrap class="menu_top_passive" onClick="change('2');"><a href="javascript:;" class="menu_top">Item 2</a></td> <td id="3" nowrap class="menu_top_passive" onClick="change('3');"><a href="javascript:;" class="menu_top">Item 3</a></td> <td id="4" nowrap class="menu_top_passive" onClick="change('4');"><a href="javascript:;" class="menu_top">Item 4</a></td> <td id="5" nowrap class="menu_top_passive" onClick="change('5');"><a href="javascript:;" class="menu_top">Item 5</a></td> </tr> </table> </body> </html> The line "between" the columns is actually a background image in the second column. I'd like to reduce the area between the top of the text and the top of the div (so the text is about even with the line). I've tried setting the padding to 0, but that has no effect. Any ideas? Code: #inner_wrap_2_col { margin:0 auto; width:690px; } #news_col_left { float:left; width:345px; color: #330; line-height: 1.5em; padding: 0; } #news_col_right { float:right; width:345px; color: #330; line-height: 1.5em; background:url("./images/news_bg.gif"); background-repeat: repeat-y; } Admin Page Okay, on that page the left side navigation menu I setup a table along with some DIV tags with CSS to put a little border around each division of the page. For some reason the padding around the header for each box is rather large when I view it in internet explorer. I set the padding to 1px on the header div and the nav div. The odd thing is in dreamweaver's preview window everything looks fine except for a spilt between each div tag. Am I missing something? Here is part of my CSS code: /*Admin Page*/ H1 {font-size:20px; text-align:center; text-indent: .1em; font-weight:bold; font-family:Garamond; letter-spacing: .1em } H2 {font-size:18px; text-align:center; text-indent: .1em; font-weight:bold; font-family:Garamond; letter-spacing: .3em } .admin-nav{ font-size:14px; font-weight:400; font-family:Arial; border:1px solid black; padding: 10px; background-color:#CCCCCC } .admin-nav-header{ border:1px solid black; padding: 1px; background-color:#CCCCCC } Heyhey Probably a very simple solution to this, but I just can't find it. Nesting DIVs and adding padding to the parent, so I can position the DIV within. I'm subtracting the amount of padding I am using from the width and height so that everything else around it will fit ok. Works fine in all browsers, apart from IE 5.5, which ignores the padding (thus making the div too small because of the subtracting of width and height from the parent DIV). Sample code: #holdera { background:url(images/header_banner_a.png) no-repeat; width:80px; height:57px; padding-top:25px; padding-left:80px; float:left; } #buttona { width:62px; height:27px; } I could use margins on the inner DIV instead, but that brings up a problem with Netscape. The DIV positions shift because of no padding on the parent. Real pain, anybody have any suggestions? Cheers Hello. I have a horizontal nav bar with a background color. When I add left padding it does do that but adds that amount of space onto the right side of the div so it's sticking out of my layout. What am I doing wrong? Here is my code: Code: body { font-family: Arial, Helvetica, sans-serif; background-color: #C0BFAB; background-position: 195px 140px; margin-left: auto; margin-right: auto; width:800px; } #header { position: absolute; margin-left: 140px; margin-top: 5px; width: 790px; height: 173px; z-index: 2; background-image:url(images/header.gif) } #topnav { position: absolute; margin-left: 140px; margin-top: 178px; width: 790px; height: 17px; padding-left: 2em; font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color:#C0BFAB; background-color:#786350; z-index: 31; } #main { position: absolute; margin-left: 140px; margin-top: 195px; width: 790px; height: 606px; z-index: 3; } #footline { position: absolute; margin-left: 140px; margin-top: 802px; width: 790px; height: 13px; background-color:#786350; z-index: 18; } #footer { position: absolute; margin-left: 140px; margin-top: 815px; width: 790px; height: 34px; z-index: 19; background-image: url(images/footer.gif); top: 0px; } #bottomnav { position: absolute; margin-left: 140px; margin-top: 815px; width: 790px; height: 13px; padding-right: 10px; font-family: Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; color:#786350; text-align: right; z-index: 32; } .binkwaffle { font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #FFFFFF; background-image: url(images/Aric-Smiling-gradient-BG.gif); background-repeat: no-repeat; margin-left: auto; margin-right: auto; } .style1 { font-family: Georgia, "Times New Roman", Times, serif; background-color: #FFFFFF; background-image: url(images/Aric-Smiling-gradient-BG.gif); background-repeat: no-repeat; margin-left: auto; margin-right: auto; font-size: 14px; } Code: <HTML> <HEAD> <TITLE>binkwaffle</TITLE> <style type="text/css"> <!-- @import url(binkwaffle_test.css); --> </style> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> </script> </HEAD> <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <div id="header"></div> <div id="main" class="binkwaffle"></div> <div id="footline"></div> <div id="footer"></div> <div id="topnav">home cards faq about contact</div> <div id="bottomnav">home cards faq about contact</div> </BODY> </HTML> Also the centering doesn't seem to be working. Thanks for the help. Hello friends I try to put padding and borders in a image with the follow code : img { border: 1px solid #666666; padding: 3px; } It works with the firefox and opera but not with IE ... Why? Thanks Im running IE6 and its on an Intranet so for the moment Im only keen on getting it to work in IE5/6. I have got the following HTML and CSS. When I remove the CSS 'display: block; padding-bottom: 0px;' the links list views fine, but when I include it, the list spaces right out and I can't control the level of padding. Its really weird.. Im pretty sure this is where the error is but Im not exactly sure what it is.. I have not had problems in the past implementing a display type of BLOCK before, so not sure what is doing it now... Any ideas would be great... Can post the whole template and assets if that helps... Code: <ul><li class="mainNav"><a href="about.htm" onMouseOver="MM_showMenu(window.mm_menu_1111120312_5,180,160,null,'navigation1');" onMouseOut="MM_startTimeout();">About Us</a></li> <li class="mainNav"><a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1015140727_0,170,170,null,'navigation1');">Our Programs</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020105028_0,170,185,null,'navigation1');">Managing our People</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020115125_0,170,195,null,'navigation1');">Managing our Money</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020121338_4,170,220,null,'navigation1');">Supporting our Business</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020121623_3,170,235,null,'navigation1');">Ministerial and Parliamentary</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020121709_2,170,255,null,'navigation1');">IT Systems & Support</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020121752_1,170,275,null,'navigation1');">Staff New & Events</a></li> <li class="mainNav"> <a href="1.htm" onMouseOut="MM_startTimeout();" onMouseOver="MM_showMenu(window.mm_menu_1020121857_0,170,290,null,'navigation1');">Staff & Territory Offices</a></li> </ul> ############## CSS li.mainNav { list-style: url('../images/common/navarrow.gif'); margin-bottom: 5px; font-size : .80em; } li.mainNav a:link { display: block; padding-bottom: 0px; color: #283164; text-decoration: none; } li.mainNav a:visited{ display: block; padding-bottom: 0px; text-decoration: none; } li.mainNav a:hover { display: block; padding-bottom: 0px; text-decoration: underline; } li.mainNav a:active { display: block; padding-bottom: 0px; text-decoration: underline; } I'm using the following code. I'd like the DIV that surounds the up / down images to more tightly wrap the images (there is too much space between the top and bottom border and the images). I'm having trouble understanding how to accomplish this. Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Untitled</title> <style> .nav_box { width: 95%; padding: 1px 1px 1px 2px; margin-top: 10px; margin-bottom: 10px; border: 1px solid #003366; background-color: #eef7ff; text-align : left; } </style> </head> <body> <div class="nav_box"> <img ... /> <img ... /> Row Zero </div> </body> </html> Hi I'm having a problem with padding <a> tags in firefox i have a div inside another div. I'm using the 2nd div as a button but it doesn't fit inside the containing div. The top and bottom stick out. Any clues? here is my code: Code: <html> <head> <style type="text/css"> .mybox { border: 1px solid #000000; } .buttonbox{ /*padding: 5px;*/ } .buttonbox a{ padding: 5px; background-color: #33F4FF; border: 1px solid #FF0000; } .buttonbox a:hover{ background-color: #EBF4FF; } </style> </head> <body> <div class="mybox"> <div class="buttonbox"><a href="asdfasfd">buttonbox</a></div> </div> </body> </html> CSS pisses me off. Just about every new class I implement, I have to debug it for either IE or Firefox. I can't figure this one out, anybody wanna help? In Firefox, when I use padding on the #inner-box instance, the container overflows. It should only extend to the end of the white line. It works fine in IE. http://www.rhizaowns.com/holly/index.php |