CSS - Problem With List Items Padding In <ul> Tag
Hi,
I'm having a problem with some padding showing up oin both IE and Firefox with list items on my navbar. Please see: http://81.17.252.110/~wallis1/new/ I want the nav items to come to the edges of the <ul> tag (want to make the white borders on the navigation items come to the edge) but there is this padding there for some unknown reason between the <ul> and the <li> items. Please can you help as I'm tearing my hair out now, Thanks in advance, Similar TutorialsI've tried the popular tricks to figure this out, but don't seem to have the touch. In IE, the list item is 2px taller than in FF. page: URL Removed CSS: Code: .mainNav ul {margin: 0; padding: 0; list-style: none;} .mainNav ul li {border-top: 1px solid #27466c; border-bottom: 1px solid #021940; background: url('../images/menu_bg.gif') top left repeat-y; display: block;} .mainNav ul a, .mainNav ul span {display: block; height: 17px; padding-top: 4px; font: 11px Verdana,Sans-Serif; color: #ffffff;} .mainNav ul a:link, .mainNav ul a:visited {text-decoration: none;} .mainNav ul a:hover{text-decoration: none; color: #9fb3cb;} .mainNav ul ul ul a:hover, .mainNav ul ul ul ul a:hover {text-decoration: none; color: #3e5064;} .mainNav ul ul li {border: 0; background: url('../images/sub_menu_bg.gif') top left repeat; border-top: 1px solid #627996;} .mainNav ul ul ul li {border: 0; background: url('../images/sub_sub_menu_bg.gif') top left repeat; border-top: 1px solid #627996;} .mainNav ul ul ul ul li {border: 0; background: url('../images/sub_sub_sub_menu_bg.gif') top left repeat; border-top: 1px solid #627996;} .unselected, .selected, .empty {display: block; float: left; height: 21px; width: 22px;} .currentPage {border-right: 4px solid #000530; margin-right: 1px;} HTML on page (it's quite heavy) Hi, I have an OL list (the numbered one) and the horz gap between the list item number (as automatically generated by OL) and the text of the LI is too big (according to client). Looks fine in FF but is bigger alright on IE (ahem naturally .....) I've played with the CSS for both the OL & LI styles even setting all margins and paddings to 0 but without effect on the gap. Is there any way to style that gap? Code below. Kevin <ol class="most_read"> <li class="most_read_li">Apples</li> <li class="most_read_li">Oranges</li> </ol> .most_read { text-align:left; color:#808080; font-size:10px; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight:normal; margin-left:30px; padding:0px; margin-top:5px; } .most_read_li { margin-bottom:7px; margin-right:7px; } whats the CSS for creating an unordered list that goes across the page rather than down with no bullet points? Hi, I have a list of items, but when one item goes onto the next line, It doesn't align with the text above it. Here is an example. Look at the right hand column, and notice how the list items, when they go into 2 lines, the second line aligns with the bullet point and not the text. Anyone know how to fix this? thanks Hi Guys, I am trying to incorporate a CSS file into an xml document.I have the following problem. My XML file is: <!-- example of an list item --> <?xml-stylesheet type="text/css" href="styledocument.css" ?> <document> <employee> <firstname>peter</firstname> <lastname>lance</lastname> </employee> </document> My corresponding styledocument css file is : employee {display:list-item;color:red;} firstname {display:inline;} lastname {display:inline;} --- Output in IE5: peter lance ----- The expected output should be peter and lance as list items with bullets preceding them and in red color. But my output is peter lance in just red color without any bullets. List-item value of the display attribute is not recognised at all. Can u help deal with this problem!!! how do you remove the "padding" of the ul on the left hand side? At h**p://www.topofferspage.com in IE6, the bullet points do not have images appearing unlike Firefox. Before anyone says it's because of validation errors, it's not. I can turn off the offending stylesheets just fine and I get the same problem. Little help? Why would background images not work in IE6 but every other browser? I have a list, Each item has a graphic as a background image, so each li is 60px high Some of the text is long and wraps Some of the text remains on one line This means the the spacing is not consistent and looks a little odd I've tried Code: ul#myListId li { vertical-align:middle; } and Code: ul#myListId li * { vertical-align:middle; } This has no effect in any of the browsers We have a list of items that are not lining up under each other. The list of items is under a class 'item-list', each individual item that is in the list is listed as an instance of the same class ''view-item view-item-RecentReviewSummary'. Each list item consists of a title (a link), a small photo to the left with labels/text wrapping around the photo on the right. It happen when the page is wide (different monitors, resolutions etc) and in cases where the text wraps under it's photo (ie long enough text to require an extra line under the photo). We were trying to use display: block, margins and positions to fix this. any ideas? Thank you. Some HTML/CSS following HTML for first list item: <div class="item-list"> <ul> <li> <div class='view-item view-item-RecentReviewSummary'> <div class='view-field view-data-node_title'><a href="/millennium_park_lake_shore_walk">Millennium Park/Lake Shore Walk</a> </div> <div class='view-field view-data-node_data_field_small_image_field_small_image_fid'><img src="(URL address blocked: See forum rules)/files/ac_millennium_park_small.jpg" alt="Millenium Park" title="Millenium Park in the heart of Chicago" width="150" height="150" /> </div> <div class='view-label view-label-node_data_field_reviewer_rating_field_reviewer_rating_value'>AC Rating </div> <div class='view-field view-data-node_data_field_reviewer_rating_field_reviewer_rating_value'>3 </div> <div class='view-label view-label-node_data_field_description_field_description_value'>Summary </div> <div class='view-field view-data-node_data_field_description_field_description_value'>Check out the amazing "Cloud Gate" sculpture at Millennium Park and then walk across Lake Shore Drive, Stroll along the Lake and then circle back through Grant Park toward Buckingham Fountain. This trip can be made easily with a wheelchair if your attendant likes to hike, however, the roughly two mile stroll may be a lot if you are on your own. Start by parking your car in the Grant Park North Parking Garage. </div> </div> </li><li> CSS: (each list item is a link, fields/labels and an image) #view-label {} .view-label-node_data_field_reviewer_rating_field_reviewer_rating_value { /* AC Rating label */ float: left; padding: 0 5px 0 0; color: #369; font-weight: bold; text-decoration: italicize } .view-label-node_data_field_description_field_description_value { /* Summary label */ color: 369; font-weight: bold; width: 350px; padding: 4px 5px 0 0; } #view-field {} .view-data-node_title { /* attraction title value */ We thought putting code here would fix but didn't.... } .view-data-node_data_field_reviewer_rating_field_reviewer_rating_value { /* rating nbr */ position: relative; top; float right; background: url('fourstars.gif') no-repeat top left; padding: 0 0 0 10px; } .view-data-node_data_field_description_field_description_value { /* summary text */ margin-bottom: 15px; font-size:.8em; } .view-data-node_data_field_small_image_field_small_image_fid { /* image */ float: left; margin-right: 5px; Hi I'm writing here after spending a few hours searching google without luck. I bought a "mega menu" plug in for wordpress but its acting very odd. It generally works as it should but ive found that theres something wrong with the formatting of the drop down menus. There is an issue where line breaks do not happen at all, and most important - list items are not shown on a new line. The content all seems to flow around its self rather than being formatted. See attached pic: img14 .imageshack .us/img14/964/screenshot047cr .png I did run the css and html though a validator and it spits out hundreds of errors but i think they are pretty much only shown because its css3. I'm really curious what would cause line breaks to not appear after list items. I had thought previously it may be the css clashing with my themes css but i tried a fresh install on a really mimimal theme and the error is still there I have an unordered list of 4 items that I have styling to be a horizontal navigation. I have set the css of the li to have a width of 25%. This works fine when the screen is full width but as I scale the browser to have a smaller width the text inside the li wrap - as to be expected. My question is, is there a way of ensuring that all 4 li's have the same height even when the content is of different lengths (thus some of the li's content do not wrap). Also can this be done purely in CSS without the use of Jquery? Thanks in advance hello! i'm trying to line up some text in my unordered list but haven't been able to figure out the CSS to make it look something like this: Code: Accomplishments: Job title some job here another job yet another job Duties Designed company website. Proofread advertisements Code: <div id="resume"> <h4>Accomplishments</h4> <ul> <li>Job title</li> <ul> <li>some job here</li> <li>another job</li> <li>yet another job</li> </ul> <li>Duties:</li> <ul> <li>Designed company website.</li> <li>Proofread advertisements</li> </ul> </ul> </div> so i tried doing stuff like Code: div#resume ul li ul { position:absolute; top:-20px; left:50px; } div#resume ul li ul li{ float:none position:relative; } i can't get the words, "Job title" to line up horizontally with the first list item, then have the list items listed vertically like in my example up top (i know it doesn't line up perfectly in here) can someone correct my css?? thanks! drGiggles As the title says... Design constraints unfortunately mean I need to do achieve the basic design shown in the example below (using a list) I have created an example to illustrate the problem I am experiencing. Problem example The list item text is wrapping too early in IE6 and IE7, though fine in my other target browsers such as Firefox and Opera. removing clear:left stops the wrapping, but then when 2 or more nav items have short content they sit on the same line which is no good obviously Any ideas / solutions etc. would be most welcome I have a list that is made sortable via jquery UI's sortable plugin. I have it worked fine in all modern browsers but I get overlapping in IE8 and IE7 is just a mess but I'm less concerned about that. Working Example Click and drag Item 5 up above Item 4 and drop there. You can see the issue. It works initially but I'm not sure why IE8 isn't clearing the float after it is dropped. Maybe it is a javascript issue instead of CSS? Hi, I'm using a right-to-left layout and I can't find a way to display my list items correctly on Firefox. When I insert something into the rtl div with a float, the list item does not wrap correctly. 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> <style type="text/css"> <!-- #content { margin:0 200px 0 20px; border: 2px solid #000; direction:rtl; } #floatdiv { width:100px; height:100px; margin:10px; border: 1px solid #000; float:left; } --> </style> </head> <body> <div id="content"> <div id="floatdiv"</div> <p>This is a test</p> <ul> <li>item 1</li> <li>item 2</li> </ul> </div> </body> </html> Is there a problem in my code? Thanks, Ehud. Anyway to remove the automatic line break after list items? I'd like to use styles to create roll-over effects in a menu I've used an unordered list to create that menu. But, I'd like a horizontal menu bar rather than a vertical menu column. Thanks! David Goldfeder Hello, I am not sure if this is even possible but is there a way to apply css styles to a specific number of list items sequentially? For example, lets say I have a menu made from an unordered list. There are 5 <li> tags, and I want to make the first 3 have red text, but I want the last two to have white text. I can't assign specific classes because I am using a CMS and it writes the code for me. (I wish I didn't have to use a CMS but I have no choice). Is this possible? Thanks in advance! 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> 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?? I have a horizontel list as my menu with a 1px border to the right of each item as a seperator. Each item has 10px padding to the left and right. In all browsers it shows up as expected in the middle of the menu items but in Explorer the border is way closer to the right, almost pushed up against the item to the right. Any help please. |