Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spans inside paragraph per line

Tags:

html

css

I have:

name: james

but I want to be shown as:

name:
james

Here's a live example of this

HTML markup:

<p>
<span class="bla">name:</span>
<span class="bla">james</span>
</p>

CSS markup:

.bla {
 display: inline-block;   
}​

Thanks in advance

like image 631
Luis Avatar asked Dec 09 '22 23:12

Luis


1 Answers

inline-block isn't going to achieve what you are after, if you are wanting to do this by adding styles to the .bla class. Try changing it to display:block instead.

See my Example: http://jsfiddle.net/n1ck/NNpqq/1/

.bla {
 display: block;   
}​

Or you can add some markup: http://jsfiddle.net/n1ck/NNpqq/5/

<p>
    <span class="bla">name:</span> <br />
    <span class="bla">james</span>
</p>
​
like image 108
N1ck Avatar answered Jan 05 '23 20:01

N1ck