Recently I started learning HTML + CSS and ran into a problem, passing moments with child selectors. There is a simple code:
<div> <p>Известно, что пустыня обладает неправильной формой, которую принимаем прямоугольной. Это достигается одним из двух способов — <i>включением частей</i>, выходящих за пределы области пустыни или их <i>отбрасыванием</i></p> </div> <p> <h1>Текст1<h2>Текст2</h2></h1> </p>
Styles are:
p > h1{ color: red; } h1 > h2{ color: blue; }
Neither the first nor the second style works at all. I do not know why this is happening.
h
not embedded one into the other. There is also no need to put them inp
. Tag hierarchy must be observed. - Rustam Gimranov