Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS list item query

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #35368
    stevedeer
    Member

    Just playing here but, on my fiddle…

    http://jsfiddle.net/stevedeer/3qK4f/

    For my bold list item to have some padding above it, I have had to add ‘display:block;’ to the css…

    li span {
    display:block;
    font-weight: bold;
    padding-top: 10px;

    But I am informed that li elements are already block level, so why do I have to add this css for it to work?

    Thanks in advance

    Steve

    #91433
    SgtLegend
    Member

    elements are inline elements which is why they don’t work with margins and padding by default.

    #91434
    stevedeer
    Member

    Hi Sgt… but even when I change the span to a class and remove the ‘display:block;’ in the css, it doesn’t work

    li .paddbold {
    font-weight: bold;
    padding-top: 10px;

    the new fiddle shows it not working…

    http://jsfiddle.net/stevedeer/CbZNk/

    Steve

    #91435
    stevedeer
    Member

    is it right for me to assume that it is the span tag that I have originally and rightly made block level for it to work?… just really confused.

    #91437
    stevedeer
    Member

    solved it… I removed the space between li and .paddbold

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.