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

Home Forums CSS How to organize codes

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #271182

    Hi all,

    I’m new with css I am trying to do this simple site for our knowledge base. as you can see the code seems repetitive. How can we make it simple that would not make me create too many classes.

    Here is my code pen. I put my css code in the html portion as well.


    Instead of doing this;

    h1 { color:red }
    h2 { color:red }
    h3 { color:red }
    h4 { color:red }
    h5 { color:red }
    h6 { color:red }

    You can comma separate selectors with the same styles;

    h1, h2, h3, h4, h5, h6 { color:red }

    This will cut out a lot of repetition.

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