I'm in need of some help. I have a CSS dropdown menu but i want the titles to be centered so on all screen sizes it would be in the middle, as at the moment its stuck to the left.
Any help would be greatly appreciated.
Here is a bit of the HTML code:
<div id='cssmenu'>
<ul>
<li><a href='events.html'><span>Events</span></a></li>
</ul>
replace this css with what you have for #cssmenu > ul > li:
and add this to your css codes:
here it is: http://jsfiddle.net/y4vDC/10/
You need your
li
elements to beinline
, and then usetext-align
on the parent element to center them:In order that they stay as
inline
, you need to delete the float from the list elements.http://jsfiddle.net/y4vDC/13/
you have at least 2 easy options:
display:table
andmargin:auto;
http://jsfiddle.net/y4vDC/11/display:inline-block
andtext-align:center
on parent http://jsfiddle.net/y4vDC/12/