Completed the project successfully but needed to know how to place text-indent on only the first paragraph on the section element
Nice work @madefromjames
To achieve this you can use the adjacent sibling combinator: section h2 + p
. It will only sect the paragraph that is directly after the heading.
The selector .a:visited
doesn’t work because the leading dot would select the class “a” and not the tag “a”.
Another thing that I think could be improved is the click zone in the nav. It would be nice if we could click anywhere in the box to trigger the link. To achieve this you could add display: block;
to nav a
and move the padding from nav li
to nav a
.
I hope that helps.
See you,
Michael
I searched Google for the answer earlier but only found p +p for it but that only placed text-indent on only the second paragraph… Thanks @mikoMK for the explanation on how to go about it
You’re welcome!
p + p
is quite useful if you want to have some margin between paragraphs but not above the first one or below the last one. You could do something like this:
/* Only select paras that have another para before.
In other words: All paras but the first one. */
p + p {
margin-top: 20px;
}