Forums

Give help. Get help.

  • # May 15, 2018 at 5:46 pm

    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.

    # May 15, 2018 at 9:43 pm

    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)

You must be logged in to reply to this topic.

icon-anchoricon-closeicon-emailicon-linkicon-logo-staricon-menuicon-nav-guideicon-searchicon-staricon-tag