Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How to selects every <p> element that is the second <p> element of its parent ?

user-image
Question added by doaa elsayed , معلم حاسب ألى , مدرسة الأنفوشى الرسمية (لغات)
Date Posted: 2017/04/10
medhatmahmoud mahmoud
by medhatmahmoud mahmoud , Web Designer , Connect Computer Service Co

<!DOCTYPE html>

<html>

<head>

<style> 

p:nth-of-type(2) {

    background: red;

}

</style>

</head>

<body>

 

<p>The first paragraph.</p>

<p>The second paragraph.</p>

<p>The third paragraph.</p>

<p>The fourth paragraph.</p>

 

</body>

</html>