Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List items run outside of list and div area

I'm having an issue with a menu un-ordered list. Whereby the list items are over running the <ul> and <div> boundaries and only starting the next line once it has reach the edge of the screen.

Heres the website: http://finalonline.co.uk/mypics/gallery/categories/

like image 929
crmepham Avatar asked Jan 04 '12 17:01

crmepham


People also ask

Can a list item contain a div?

Actually, according to the HTML5 draft, the content model of the dt and dd elements is "flow content", so a div is allowed in both of those.

How do I display list items side by side in HTML?

1. Display: Inline-Block. The first way you can use is the display: inline-block method. This method is a simple and classic CSS technique for positioning elements side by side.

How do you separate list items in CSS?

The list items can be separated with a margin on the "LI" element. In this case margin of "0.2em" was applied to the bottom of the "LI".

How do I reduce space between lists in CSS?

The spacing between list items in an orderedlist or itemizedlist element can be minimized by the document author by adding a spacing="compact" attribute to the list element. In HTML output, the list will get a compact="compact" attribute on the list start tag to reduce spacing in the browser.


1 Answers

Do display: block; always... Never do display: inline; or display: inline-block;

To fix the Unordered List from pouring out of the DIV, try going into the CSS and apply this:

ul {
list-style-position: inside;
}
like image 167
Aaron Brewer Avatar answered Oct 02 '22 04:10

Aaron Brewer