HTML - Center Unordered List
I have a list that's unordered, and I'm having a hard time figuring out how to make it centered as a whole instead of individual lines.
The list would look something like: * Item 1 - Subitem 1 - Subitem 2 * Item 2 - Subitem 1 I want to center the entire unordered list, not center each row individually. Any ideas? Similar TutorialsI'm having a very odd problem with unordered lists. I have made them before like this and they have worked just fine, its odd that now its not working on any browsers. Did HTML standards change lately? Code: <ul style=" list-style-type:circle"> <li><a href="#sitespecs">Site Specs</a></li> <li><a href="#sitehistory">Site History</a></li> </ul> http://www.animeffz.com/codegeass/siteinfo.php Thats all the code i have involved with it =/ but nuttin is showing up. Not a single mention of them in my CSS also. G'day, My unordered list (vertical nav menu) is displaying differently in IE and Firefox. IE displays each item with a large amount of space between them, while FF does not. I want to have a few pixels space between each item, and how do I do this so FF and IE both show the same? Here is the code: Code: #leftnav ul { list-style-type:none; color: #fff; display: block; text-align: left; margin: 0px; padding: 0px; } .menu A:link { display : block; padding-left : 0px; text-decoration : none; color:#000000; font-family: Verdana; font-size: 8pt; font-weight: bold; } <div id="leftnav"> <ul> <li class="menu"><a href="#">Home</a></li> <li class="menu"><a href="#">Services</a></li> <li class="menu"><a href="#">PT One on One</a></li> <li class="menu"><a href="#">PT Group Fitness</a></li> <li class="menu"><a href="#">Pre & Post Natal Fitness</a></li> <li class="menu"><a href="#">Senior Fitness</a></li> <li class="menu"><a href="#">Fit Kids</a></li> <li class="menu"><a href="#">Pre Wedding Packages</a></li> <li class="menu"><a href="#">About Us</a></li> <li class="menu"><a href="#">Testimonials</a></li> <li class="menu"><a href="#">Monthly Tips</a></li> <li class="menu"><a href="#">Impel Thanks</a></li> <li class="menu"><a href="#">Contact Us</a></li> </ul> </div> Thanks for any help guys, very much appreciated. Cheers, Jamie I have an unordered list on my page and the links continue after the /a in the webpage. The link can be clicked until the end of the line instead of just the words themselves. Also, with IE7 I noticed that the hover changes all the way until the next list item starts. Here's the link and css info: http://www.yotti.de/englishcourses.html .rccovers { position:absolute; width:650px; margin:0 0 0 150px; text-align:justify; } .rccovers a { color: #666; cursor: pointer; display:block; text-decoration:none; font-weight:700; } .rccovers a:hover { font-size:12px; background:#fff; color:#000; } Thanks for any help you can give. Hey Guys, This is my first post of what I'm sure will be many more, you have a wonderful set up here on HTMLforum.com. I redesigned our eShop last week and I'm running on Mac OS X so I do most of my development in Firefox and Safari. I spent half of my day yesterday trying to sort through this IE issue with no luck.... If you go to http://www.yumsshop.com and look at the navigation menu on the left hand side you will see the various categories and sub categories for the lower level navigation around the shop. In Firefox and Safari everything displays how it should so take a look in one of those browsers so you can see how it is supposed to look. Now switch over to Internet Explorer and Welcome to my Nightmare, lol. For whatever reason the menu is staggered and completely out of alignment. I don't know if I need to have a separate style sheet just for IE with a browser detection code or what but I'm definitely in the dark on how to get this properly working. Any help is going to be much appreciated. Thanks, Taylor Leach Yums Shoes Hello, I'm trying to program a couple unordered lists into my web page and I encountering a problem. I can't seem to align them with the top of the cell. They act as if there's an extra list item above the first one. Here's the URL to the page: http://www.cactusridgerr.com/CCRR/comfort.htm Here's the code for the bottom two cells with the lists in them: Code: <tr> <td style="vertical-align: top; padding-left: 0px; padding-top: 0px;"> <ul type="disc" style="margin: 1em;"> <li>Elegant dining room</li> <li>Fireside lounge</li> <li>Library and computer room</li> <li>Craft room & country kitchen</li> </ul> </td> <td style="vertical-align: top; padding-left: 0px; padding-top: 0px;"> <ul type="disc" style="margin: 1em;"> <li>Wellness and exercise spa</li> <li>Beauty salon</li> <li>Theater and multi-purpose room</li> </ul> </td> </tr> Does anyone know why they refuse to be aligned with the top of the cells? Hi all, Im having a problem with unordered lists. When I view it in Dreamweaver, the bullet points are small, but when I view in browser, they are huge. Ive tried adding classes to the CSS, but not sure what im doing wrong. Ive got one class that is: .bulletList { padding:0px; margin:12px; } I tried adding a different class for the actual lists: .bulletSize { font-size:12px; } But all this did was change the size of the font and not the size of the bullet point. Can anyone suggest what I could do to fix this? Thanks in advance Hi, I have a bit of a problem. I am learning HTML and CSS, and I am trying to make a simple menu withh a background button up state and a horizontal unordered list across, with a hover effect of a new bg image over the initial ones. Please help! Thanks in advance. Hello there, My site header buttons aren't showing up in Google Chrome. Design fees, web design and answers, are the only buttons that show in Chrome. The header buttons show up fine in IE, Firefox, Safari and others. Site is dreamboxdesigndotcomdotau Any help appreciated! Hey guys, this may seem as an easy solution but I've been pulling hair over it. How do I get rid of the blank line breaks that appear before and after unordered lists? I attached a picture to this thread of what I am exactly talking about. Thanks in advance! I'm trying to make a sidebar to navigate through the website and basically lays out the entire site on the sidebar (which is a tree with nodes and leafs etc), but when it tries to display the text, it gets really squished up on the right side, but there are still horizontal scrollbars -.- This is the html after all the PHP stuff: Edit: I put in "width:100em;" in the li section of css. It formatted the text properly, but then the scrollbar continues on forever. Is there any way to find out how many pixels are needed to format the text properly? More specifically, is there any way (javascript, php) to find the length of a string in pixels? 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"> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("div#navigation").height(window.innerHeight-16); }); </script> <!--<link type="text/css" rel="stylesheet" href="Styles.css" />--> <style type="text/css"> #navigation { position:absolute; width:25%; height:500px; background-color:#C0C0C0; margin:0px; border:0px; padding:0px; float:left; overflow:scroll; overflow-x:scroll; overflow-y:scroll; } #main { width:75%; height:100%; } li { overflow:visible; } </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled</title> </head> <!--Use a tree for this--> <div id="navigation" > <ul><li>FoodFoodFoodFoodFoodFoodFoodFoodFoodFoodFoodFoodFo</li> <ul><li>FruitFruitFruitFruitFruitFruitFruitFruitFruitFruit (Level 2)</li> <ul><li>RedRedRedRedRedRedRedRedRedRedRedRedRedRedRedRedRe (Level 3)</li> <ul><li>CherryCherryCherryCherryCherryCherryCherryCherryCh (Level 4)</li> <li>StrawberryStrawberryStrawberryStrawberryStrawberry (Level 4)</li> <ul><li>Uber BerryUber BerryUber BerryUber BerryUber Berry (Level 5)</li> <ul><li>Extreme StrawberryExtreme StrawberryExtreme Strawb (Level 6)</li> <ul><li>WOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWOWWO (Level 7)</li> <ul><li>supercalifragilisticexpialadocioussupercalifragi i (Level 8)</li> </ul></ul></ul></ul></ul><li>YellowYellowYellowYellowYellowYellowYellowYellowYe (Level 3)</li> <ul><li>BananaBananaBananaBananaBananaBananaBananaBananaBa (Level 4)</li> </ul></ul><li>MeatMeatMeatMeatMeatMeatMeatMeatMeatMeatMeatMeatMe (Level 2)</li> <ul><li>BeefBeefBeefBeefBeefBeefBeefBeefBeefBeefBeefBeefBe (Level 3)</li> <li>PorkPorkPorkPorkPorkPorkPorkPorkPorkPorkPorkPorkPo (Level 3)</li> </ul></ul></ul></div> </html> I have a big list and I want to show on my webpage 6lines from that list randomly (when webpage is refreshed another 6 lines appear). can anyone help me with he code, how should the list look like so it works...or where can I find more info on this ? thanks I am making a website with a list inside list for my navigation bar. It looks good on safari(win/mac) and firefox but the list looks horrible in IE7.0(didnt check 6.0) I was wondering if anyone know what it could be HTML Code: Code: <div id="nav"> <img class="menupic" src="images/mainmenu.png" alt="Main Menu"/> <ul class="navli"> <li><a class="point" href="#"><img src="images/menu_findme.png" alt="findMe"/></a></li> <li> <ul class="navlinks"> <li><a href="#goto_facebook" id="facebook">- Facebook</a></li> <li><a href="#goto_myspace" id="myspace">- Myspace</a></li> <li><a href="#goto_youtube" id="youtube">- Youtube</a></li> </ul> </li> </ul> <ul class="navli"> <li><a class="point" href="#"><img src="images/menu_blog.png" alt="blog"/></a></li> <li> <ul class="navlinks"> <li><a href="#blogid2" id="blogid2">- Testing | May 01</a></li> <li><a href="#blogid1" id="blogid1">- Debut Album | Apr 30</a></li> <li><a href="#goto_blogarchive" id="blogarchive">- Archives</a></li> <li class="donthidethis"><ul class="navli donthidethiseither" style="padding:0;"> <li><a class="point" href="#">- Categories</a></li> <li><ul class="navlinks"> <li><a href="#goto_catid2" id="catid2">- Media</a></li><li><a href="#goto_catid1" id="catid1">- News</a></li><li><a href="#goto_catid3" id="catid3">- Off Topic</a></li><li><a href="#goto_catid4" id="catid4">- Tutorials</a></li> </ul></li> </ul></li> </ul></li> </ul> <ul class="navli"><li><a class="point" href="#"><img src="images/menu_eliasmusictv.png" alt="eliasMusic Tv"/></a></li> <li><ul class="navlinks"> <li><a href="#" id="coming">- Coming soon...</a></li> </ul></li> </ul> <ul class="navli"><li><a class="point" href="#"><img src="images/menu_about.png" alt="about"/></a></li> <li><ul class="navlinks"> <li><a href="#goto_biography" id="biography">- biography</a></li> </ul></li> </ul> <ul class="navli"><li><a class="point" href="#"><img src="images/menu_links.png" alt="links"/></a></li> <li><ul class="navlinks"> <li><a href="#" id="links">- Coming soon...</a></li> </ul></li> </ul> <ul class="navli"><li><a class="point" href="#"><img src="images/menu_contact.png" alt="contact"/></a></li> <li><ul class="navlinks"> <li><a href="#goto_contact" id="contactpage">contactForm</a></li> </ul></li> </ul> CSS Code: Code: #nav { float:right; width:195px; padding-left:20px; background:url("images/navback.png"); } #nav ul { list-style: none; margin-left:1px; border: none; } #nav .navli { padding-top:3px; padding-bottom:3px; } #nav .navlinks { padding-left:25px; } #nav .navlinks a,a:link { color:#262626; } #nav .navli img { margin-top:5px; margin-bottom:5px; } #nav .navlinks a:hover { color:#dadada; } #nav img.menupic { margin:20px 10px 5px 95px; } #nav a { font-size:14px; display:block; } #nav a.point { font-size:14px; font-weight:bold; } .navliover { background:url("images/navhover.jpg"); } Any help at all would be appriciated please I can show u the website via Private message if you are interested in helping Thanks in advance Reply With Quote I have a webpage with a header, column on each side, footer and a mainContainer in the middle. I would like to set up links on the left column that, when clicked, open a new 'page' in the center (mainContainer). I am using all div tags, no tables. Could someone point me in the right direction? TIA Hey felllas. I really need some help here. I'm building this page, but can't get it to center. I bet it's somethign dumb I'm overlooking. could you please take a quick look at the source and LMK what I'm missing... http://bravoad.com/BravoTest2.html Thanks in advanced I Can't center my whole nav bar in the middle of the sidebar 1 div. Here is the link for the website. http://northwindappaloosas.com/NewHome.html I am administering this forum www.br-eeze.com So please enter there as the flashing banner and the weather widgets. Both are positioned on the left. Now this is the code for the banner: <td align="center" valign="top" width="90" height="55"><A target = "_blank" HREF="http://www.br-eeze.com"><IMG SRC="http://www.xxx.com/test1.gif" border=0 width=728 height=90 ></a> As you can see I tried to center it. I even typed right but still everything is aligned to the left. PLEASE, how do I center the banner and the weather widgets? <tr> <td class="contentarea_b"></td> </tr> <h3>=WFC= WAR FORCE CLAN AMERICAS ARMY</h3> <table cellpadding="0" cellspacing="0" border="0"><tr><td><object type="application/x-shockwave-flash" data="http://video.google.com/googleplayer.swf?docId=4279961105245592436&hl=en" height="350" width="425" style="width:400px; height:326px;" id="VideoPlayback"> <param name="movie" value="http://video.google.com/googleplayer.swf?docId=4279961105245592436&hl=en" /> <param name="allownetworking" value="internal" /> <param name="allowScriptAccess" value="ALWAYS" /> <param name="enableJSURL" value="TRUE" /> <param name="enableHREF" value="TRUE" /> <param name="saveEmbedTags" value="true" /> <param name="flashvars" value="" /> </object></td></tr><tr><td> </table> </td> Hey im new at this html programming and im ok at it but i still need to learn more i need help centering the stuff on my page you will see what i mean if you go to my website. firefoxskins.awardspace.com. I would really like help thank you for your time. http://www.ivoog.com/test/help The boxes that have: Paypal, Policies, Financing, Wholesale, etc. How can these be centered in all browsers including IE6? I can't get it to work Here's the CSS: #othermain2 { width:850px; height:850px; float:left; } #middlestyle { width:850px; text-align:center; margin:auto; overflow:auto; } .middlebox { width:150px; text-align:center; float:left; font-size:24px; margin-left:50px; margin-top:50px; border:solid 5px #333; } .middlebox:hover { width:150px; text-align:center; float:left; font-size:24px; margin-left:50px; margin-top:50px; border:solid 5px #390; } FULL CSS: http://www.pics.ivoog.com/page/home.css Can anyone help me? Thanks. I have several div tags that I want exactly where I place them regardless of a user's screen size / resolution ... if I place them right of left 200 px then they shfit depending on resolution ... samve if I place them right of left by, say 85%. I'm figuring if I place the div tage left of center or right of center then they will always position correctly because the center doesn't vary according to resolution. How do I do this? I tried document.getElementById("divid").style.center = "25"; (i was attempting 25 pixels right of center) but it doesn't work. Any suggestions? Thanks! |