Forums

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

Home Forums CSS [SOLVED] CSS-trick: Auto-magically add colon to your labels

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38113
    jtroutman
    Member

    I’m using this css to append a colon after all my labels on forms (this prevents them from being forgotten, and allows us to generate forms from classes with MVC easily)


    form label[for]:after { content: ":"; }

    but now I have colons after my radio and check boxes using bootstrap from Twitter as the label now includes the checkbox.



    Any thoughts on overriding this?

    #102997
    alexh58
    Participant

    Well if I understand the question correctly, you could do this…

    label:not(.checkbox):after { content: ":"; }​

    Does that help?

    #102999
    jtroutman
    Member

    I’ve never used the NOT operator that’s sweet!

    label:not(.checkbox, .radio):after { content: “:”; }​

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