简体   繁体   中英

CSS display:inline is not working

I saw that there are many questions looking like this one but can't find a solution yet.

My HTML code:

 <p class="ref" style="display:inline"> <p class="mini-caps">albums</p>: Scum (1987) ; Bootlegged in Japan (1998) </p> <p class="ref"> <p class="mini-caps">compilation </p>: Noise for Music's Sake (2 CD, 2003) </p> <p class="ref"> <p class="mini-caps">album</p>: Illmatic (1994) </p> 

I tried to style p.ref with display:inline with no success.

The output I would like to have:

albums : Scum (1987) ; Bootlegged in Japan (1998)

compilation : Noise for Music's Sake (2 CD, 2003)

album : Illmatic (1994)

why the use of the p tags? You can properly do this with div's and span's.

<div class="ref">
    <span class="mini-caps">albums</span>: 
    <span>Scum (1987) ; Bootlegged in Japan (1998)</span>
</div>
<div class="ref">
    <span class="mini-caps">compilation </span>: 
    <span>Noise for Music’s Sake (2 CD, 2003)</span>
</div>
<div class="ref">
    <span class="mini-caps">album</span>: 
    <span>Illmatic (1994)</span>
</div>

See https://jsfiddle.net/1r9Lu6y3/6/

Hope this helps

BTW: Illmatic album is sooo good!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM