ive got a list set up with a background image set to the left of each of the lines of text although they dont seem to line up, i put a span around the text to try and reposition the text but it didnt seem to work
heres the code im using..
HTML
<ul class="price-features">
<li><span>One page website with contact form</span></li>
<li><span>Social Media Integration</span></li>
<li><span>One year hosting + Domain registration</span></li>
</ul>
CSS
.price-features{
margin-top:30px;
}
.price-features li{
background-image:url(/images/prices/orange-arrow.png);
background-repeat:no-repeat;
background-position:left;
padding-left:15px;
height:30px;
border-bottom:#999 1px solid;
background-color:#996;
}
.price-features li span{
padding-top:5px;
}
http://i.stack.imgur.com/rV1LM.png
Yes, absolutely fine. An <li> can contain either block-level or inline elements.
SPAN is a GENERIC inline container. It does not matter whether an a is inside span or span is inside a as both are inline elements.
Yes, it's typically fine to use a span inside of an h1 . span is an inline element, so it's typically okay to use it inside anything (that allows elements inside it!)
As all phrasing content is flow content, it means phrasing element can be used in all of flow content. The phrasing elements can only contain other phrasing elements, for example, you can't put div inside span.
Padding only affects block-level elements. You'll need to either change your span
to be a block-level element or override the default display
to be block
or inline-block
.
.price-features li span{
display: block;
padding-top:5px;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With