March 21, 201313 yr Hello, me again. What I want to know is if it is possible to position one word in a ul li. I can sort the margin for the other words but I just want to centre the Products. Cheers Stuey
March 21, 201313 yr Add a class to the list element e.g. <li class="products"> Products </li> Then use CSS to center the text: li.products { text-align: center; } Lyndsey.
March 21, 201313 yr Author I did a span class to change the colour, could I do the text-align in that?
March 21, 201313 yr You can only do it with a <span> tag if the element is set to display:block; like this: <span class="center"> Centered text </span> .center { display:block; text-align:center; } This is because a <span> is an inline element so text-align:center; will work off the elements content width (e.g. the width of the text inside the span). However, a block element takes its width off it's container (in this case the <span> element), so the text will move to the middle of the container. Alternatively, use a block-level element like a <div>, which will work without using display:block inside the CSS (as it's display:block by default). Hope I made sense Lyndsey
Create an account or sign in to comment