Question on CSS/HTML Styling?

Hey guys,

Newbie coder here starting off and just had a quick question… Can someone explain to me why “.red-text {” knows to select itself as a “< h >” without me having to specify it like I do for the my paragraphs (when later down in the code I’m having to specify paragraphs for font and size change?

Thanks in advance, happy coding.

when you have a question, please do not post a screenshot of the code, post your actual code

this is selecting all elements that have an attribute class="red-text"

see challenge Use a CSS Class to Style an Element

Sorry, first time poster! Was worried the code would just get applied and not actually show typed out!

Thanks for explanation, reviewing the lines, I can now see why one of my < p > and < h > got selected! Appreciate your time brother!

If you have a question about a specific challenge as it relates to your written code for that challenge, just click the Ask for Help button located on the challenge. It will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

1 Like