I need UL list to be placed inside the p tag. I have added inside p tag only but it is not exactly starting inside p tag. And also p tag has 1600px of width so I need the li elements to extend beyond that width (I have scroll bar for tat). Now li elements are flowing in multiple lines.
Here is my demo
http://jsfiddle.net/VvuU4/2/
Unfortunately for you, HTML does not allow
ul(ordiv) to sit insidep, so browsers will automatically correct the DOM from this:…to look something like this:
You can verify this using their built-in developer tools. So you’ll need to change your markup. Perhaps change the
pto adiv?As for the second part of the question, this is a good place to start:
It sets the
ulto use a scrollbar when necessary, and tells inline elements within it not to wrap. It then sets the list items to be inline block items, which makes them sit side by side (like display: inline;) but behave more like block items (i.e. margin, padding, width, height work as you’d expect).