Why is the background-color more dark on p element than in h2 header ? | SoloLearn: Learn to code for FREE!

0

Why is the background-color more dark on p element than in h2 header ?

applied background to both h2, p element using css but i noticed the background is more dark in p than in h2 ? any reasons for that ? please explain me thank you :) https://code.sololearn.com/Wvi4vZ5iyBqR/?ref=app

8/28/2017 4:35:43 PM

ProLearner

2 Answers

New Answer

+6

You didn't close out your h2 tag so technically you p tags are a part of your h2. since you are applying a transparency, you are seeing the bgcolor of h2 behind p.

0

thanks. now i understand. i learned this somewhere that you can leave some tags unclosed so i assumed h2 was included in it so left it unclosed.