CSS - Padding Around Image - Cant Find Where Its Being Applied
For the life of me I cant find out what code that will align the image correctly. Currently the "previous" button on the page below has a gap on the left, and is being cropped on the right.
http://zombiemod.com/rm/nina2/main.php?g2_itemId=13 This is the image im talking about: http://zombiemod.com/rm/nina2/theme...ntrols-left.png I guess if I remove the space to the left of the previous button, it will drag the image to the corrct position so all of the image is being displayed without having the right side cropped. Here is the HTML for the button: Code: <ul id="control-buttons"> <li><button id="controls-left"> <img src="themes/ajaxian/images/controls-left.png" alt="Left" /> </button></li> <li><button id="controls-play"> <img src="themes/ajaxian/images/controls-right.png" alt="Play" /> </button></li> <li><button id="controls-right"> <img src="themes/ajaxian/images/controls-right.png" alt="Right" /> </button></li> </ul> This is the code I used to try and set the correct height of the buttons: Code: #slideshow-controls button { width: 44px; height: 59px; /*margin: 0; padding: 0;*/ background-color: #000; border: none; text-align: center; cursor: pointer; } Similar TutorialsWhy do margin and padding widths act differently when applied to a floated item in Internet Explorer? I'm trying to renew my website using css. i have a list with images inside. something like <ul> <li><img ... /></li> <li><img .../></li> </ul> my style definition looks like img { margin:0px; padding:0px; } ul { margin:0px; padding:0px; } li { margin:0px; padding:0px; } i don't want any pixels between two items (images), but i cannot find the way to do that. i always get some pixels between them... anyone can help me? thanks! Hi all, I've got a <div> tag around an image and in Firefox, it shows an extra 2 pixels of padding at the bottom of the image - Why is that and how can it be stopped? There's no blank spaces between the <div> and <img... tags. 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 IE is adding 8-10px of padding to the bottom of a div that I am placing a background-image in. It renders fine in ff, but because I am trying to match 3 parts of an image up to make one whole (I have reduced margin and padding to 0 on all 3 divs) there is this white gap between the divs?! Any ideas? 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 can not figure out how to remove the padding and margin around the triangle image so it is not indented, I would also like it if the gap between the image and the text was smaller. Can anyone suggest what I change or add to my code to do this. I am also wanting to know how I get the triangle to be part of the link, so clicking the triangle or thetext will open the sub menu. Code: <!DOCTYPE HTML> <html><head><title>working submenus</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"><!-- ul.catMenuItem { margin: 0px auto; list-style-type: none; /*margin-left: -25px;*/ background: url("triangle_right.png") no-repeat 0px 5px transparent; /*adjust 2px & 5px until it looks correct */ display: block; padding: 0px 4px 0px 15px; /*adjust until you have enough left padding to account for your bullet */ /* list-style-image: url('triangle_right.png'); */ } /* list-style-image:url('triangle_down.png'); */ ul.catMenuItem li a { text-decoration: none; padding: 0; margin: 0; } ul.catMenuItem li.catSubMenu { display: none; padding-left: 30px; margin: 0; } --></style> <script type='text/javascript'><!-- var prevCat; function menu(newCat) { if (prevCat) prevCat.style.display = 'none'; newCat.style.display = 'block'; prevCat = newCat; } onload = function() { var menus = document.getElementsByTagName('ul'); for (var a=0,x=menus.length; a<x; a++) { if (menus[a].className === 'catMenuItem') { menus[a].getElementsByTagName('li')[0].getElementsByTagName('a')[0].onclick = function() { menu(this.parentNode.parentNode.getElementsByTagName('li')[1]); } menus[a].getElementsByTagName('li')[1].style.display = 'none'; } } } --></script> </head><body> <ul class="catMenuItem"> <li class="catMenuTitle"><a href="#">Menu 1</a></li> <li class="catSubMenu"> Content 1.1<br> Content 1.2<br> <br> </li> </ul> <ul class="catMenuItem"> <li class="catMenuTitle"><a href="#">Menu 2</a></li> <li class="catSubMenu"> Content 2.1<br> Content 2.2<br> <br> </li> </ul> <ul class="catMenuItem"> <li class="catMenuTitle"><a href="#">Menu 3</a></li> <li class="catSubMenu"> Content 3.1<br> Content 3.2<br> <br> </li> </ul> </body></html> I am attempting to add what at first glance looks to be a gradient border down the sides of my container, and it has worked fine in IE, but in Firefox, said style element stops after a certain header box, before the page moves into the main content of the site (which has elements floated). Please have a look at the following page in both IE and Firefox, and you will see the problem: tombstonemedia.com/noise/venues.htm and the stylesheet for this page is: tombstonemedia.com/noise/style.css If anyone knows what exactly it is that I need to tweak in order to make the effect be cross-browser compatible, please let me know. This is a bit puzzling for me. I read that I can apply css to something based on id, which I have been doing, thats how my template is made, USING CSS :S. I need to apply css to an H2 that already has css applied to it but has a different id. Here is the page I need to do it to, view it and see why I need to. http://www.coldfusionzone.com/index.php?p=7 Look down towards where the comments are and youll see Leave a comment I need to change that to where it expands up to 40 pixels from the side, and has a black background without the stinkin date pic next to is . Now that Im talking about it im confused again. Ha ha I had it down pat but now that I need help im confused thats strange. But I need to apply a css style to it when it already has a css it.... Here the css style that controls it is on top and the css style im trying to use is on the bottom. PHP Code: div#content h2 { background: #000 url(images/date.jpg) no-repeat left center; background-color: #232323; color: #5F5F5F; padding: 2px 15px 2px 85px; border: 1px solid #494949; margin-left: 40px; margin-right: 220px; margin-bottom: 10px; margin-top: 0; font-size: 95%; font-weight: normal; } div#content#postcomment h2 { background: #000; background-color: #000000; color: #5F5F5F; padding: 2px 15px 2px 85px; border: 1px solid #494949; margin-left: 40px; margin-right: 220px; margin-bottom: 10px; margin-top: 0; font-size: 95%; font-weight: normal; } The section of my site that this effects is a login area, so I can't provide a link... I can post some code if I need to... I have a div with this class applied to it. Code: .minidaysofweek div{ width:13.6%; float:left; font-weight:bold; } It was working fine here, but when I put it in my site template, the bold doesn't work. So I added color:blue; just for testing, and it changed the color... what would keep the font-weight from being applied? The minititle class isn't bolding either like it should... <edit>FF and IE effected</edit> Hi, I have a XHTML 4.0 file and CSS in a separate file. The CSS if included within the <head> section of the HTML file works correctly and displays the page with the right formatting. However, when I move the CSS to a separate file and just use the <link> tag within the <head> section of the HTML file to link to this CSS file, the formatting is not applied. I am not sure what to do. Any quick help is greatly appreciated. Thanks xworder Hi I think this is some kind of IE 6 bug I am adding some elemnts to the page using the following code: etc... my_new_node3 = wd.createElement('span'); my_new_node3.setAttribute("class", "beep4"); my_new_node3.appendChild(wd.createTextNode("")); my_new_node3.appendChild(wd.createElement('br')); my_new_node3.appendChild(wd.createTextNode("")); my_new_node2.appendChild(my_new_node3); etc... This is not a problem and it works fine. The problem is that when I add this to the page the css (from an external style sheet) that should apply does not. It is some kind of IE bug, I have tested it extensively in Firefox, using the DOM inspector - where it works fine and I can see that all the elements have been created / added to the page correctly. I have also confirmed that the correct elements are being created in IE it is just that styles are not being applied to the created elements. The styles work in Firefox and also in IE under normal circumstances (when the elements are not created on the fly) I'm sorry that I can't give more detail, but its deeply burried in an application and I thought putting in the relevant css etc might just make it more confusing. Any help very appreciated. Thanks. Hello, Is there a way to have padding (say 15px) all around a cell, but allow for expections, like having one div element float:left and align far left against cell border while everything else is inset 15px. ie. Code: <style> #menubox { float:left; margin-left:15px; margin-bottom:7px; } .main_cell { padding:15px; } </style> <body> <table width=600 border=0 cellpadding=0 cellspacing=0> <tr> <td valign=top class="main_cell"><div id="menubox">table with menu items taht is achored far left against cell wall</div> Some text that wraps around "menubox" but needs to be padded around cell walls.</td> </tr> </table> </body> Thanks, Rey All, I have a header on this page backup.whiteslimo.com with 3 images inserted into it listing the company name, service, and contact info. My problem is that when they are displayed there is a thin white border on the bottom and right hand sides of each image. But the image doesn't have these borders. If you are in Firefox/Mozilla and you right click on the individual images and select View Image, you will see that the image itself does not have these borders. I am thinking that somewhere along some attribute is being added that is causing this but since I am a CSS neophyte (This is still my first week lol) I am not sure. Any help is much appreciated. I have nested divs and on the most outer div i apply a background-color but it is only applied to half of the divs?? it happens BOTH in firefox & IE!! PHP Code: <style type="text/css"> /********** layout of the page ***********/ #top { background-color:yellow; clear:both; } /***************** Formatting top part of the page **************/ #tag { float:left; margin-left:8em; } #login { float:right; } #logo { margin-left:2em; float:left; clear:left; } #searchBox { float:right; clear:right; } #links2 { clear:right; background-color:yellow; } #links2 li{ font-size:0.8em; display:inline; float:right; text-decoration:none; list-style:none; padding:1em; } </style> </head> <body> <div id="top"> <div id="tag"> <p id="">Zahra Zahra Ltd</p> </div> <div id="login"> <p>Login/Register</p> </div> <div id="logo"> <a href="index.php"><img src="images/site/zahra.jpg" width="65" height="59" /></a> </div> <div id="searchBox"> <form action="search.php" method="post" style="margin:0em; padding:0em;"> <label>What are you shopping for?</label> <input type="text" name="search" value="search" size="14"/> <input type="submit" name="submit" value="Go" /> </form> </div> <div id="links2"> <ul> <li>Contact Us</li> <li>Testimonial</li> <li>Return Policy</li> <li>News</li> <li>FAQ</li> <li>about us</li> <li>Home</li> </ul> </div> </div> Hey everyone, I am making a design to kill some time, and I have come across a problem. I have a menu at the top which has no top padding unless I give it padding of 87px. I find this very odd, and it happens in every browser( Firefox 2.0.0.3, Opera 9, IE6-7 ); is it a bug in CSS itself or am I doing something wrong? Here is my code, maybe I am missing something. html4strict Code: Original - html4strict Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title></title> <style type="text/css"> body { background-color: #082567; color: #FFFFFF; margin: 0; padding: 0; font-family: verdana,tahoma,"Bitstream Vera Sans",arial,helvetica,sans-serif; font-size: 12px; text-align: justify; } #top-menu { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=082567&EndColor=0C39A1&Format=jpeg ); background-repeat: repeat-x; height: 130px; } #top-menu h1 { float: left; font-weight: bold; letter-spacing: -3px; font-size: 31px; padding: 5px; } #menu { float: right; list-style-type: none; text-align: center; } #menu li { display: inline; } #menu a { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=082567&EndColor=0C39A1&Format=jpeg ); background-repeat: repeat-x; color: #FFFFFF; padding: 50px; } #menu a:hover { background-image: url( http://secretgeek.net/Gradient.aspx?Direction=H&Length=130&StartColor=0C39A1&EndColor=082567&Format=jpeg ); background-repeat: repeat-x; } </style> </head> <body> <div id="top-menu"> <h1>ryon.hunter</h1> <div id="menu"> <ul> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> <li><a href="">asdf</a></li> </ul> </div> </div> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" I validated it and it validates fine, any suggestions? I don't know exactly what to call what's going on, but i'm asuming that there is a padding issue with my menu. I have a ul that contains my menu list. The CSS and xhtml are as follows: Code: /* Menu */ li { border: 1px solid #000000; border-bottom: 0px none; display: inline; line-height: 14px; margin: 0px; margin-left: 1px; margin-right: 1px; padding: 0px; padding-left: 3px; padding-right: 3px; } ul#menu { background-image: url(img/menu.gif); background-repeat: no-repeat; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; list-style-position: inside; list-style-type: none; margin: 0px; padding: 0px; text-align: center; background-position: left bottom; vertical-align: text-bottom; } /* End Menu */ <ul id="menu"><li>Menu 1</li><li>Items 2</li> <li>Will 3</li><li>Go 4</li><li>Here 5</li></ul> (the menu is on one line, thanks to IE's whitespace issue, i broke it here for easier readablity.) the problem is: i have it nestled on top of a div, and for some reason the ul has a 1px bit of padding on the bottom. I have searched the forum and may have missed some one posting a resolution for this, but i tried every one ov the voice-family/carrage return fixes i've seen, but none work. to see what i'm talking about if my words are il formed (as they often are) click here. to view the CSS click here. Around this dropdown image? http://199.134.225.62/NW_PORTAL/sliding_menu/sliding_menu.cfm I have padding and margins all set to 0... |