I am having issues with writing some script, and hope someone has the answer. My script is constantly floating left and wont center and if I remove the float my script gets all jumbled up on top of itself and looks tacky. This is what I got.
bow would it be written? I am a really newbie at this. If I had something to reference it would help me. thanks.
You need to take the time to learn HTML and CSS. To get a working knowledge of HTML would take you 1-2 days, and maybe the same for CSS, depending on how fast your read, browse and work the learning curve. It will be the best. If you go for the official "recommendations" (standards), you should learn to browse quickly. http://www.w3.org/community/webed/wiki/HTML http://www.w3.org/Style/CSS/learning
Now as to your problem, you probably want to contain the two ul elements in a div, but really you should post a link to the page (if it is on server) or post whole HTML document or post it to JSFIDDLE and provide a link.
A general rule on centering block elements:
1. you need to set a fixed width in the contained element (say "width:35em;" or whatever is a good width
2. You need to set margin-left and margin-right to "auto". The best way to do it is "margin:Xem auto;" where Xem is whatever you want for the top and bottom, if they are the same.
3. floating for centering a single block element is not necessary. Floating inline elements and list items does not make sense, since they are contained in blocks that can be floated.
4 The floated element should come before the element(s) that are not floated in the flow of content.
5. Clearing a float is straightforward. However some have advised on clearing a float with a float. You can google it to check out this kind of styling.
Bookmarks