A pitfall of css3 nth-child(n)_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:42:41
Original
1089 people have browsed it

CSS matching selects the nth child element. You can use the :nth-child(n) selector, which matches the Nth child element belonging to its parent element, regardless of the type of the element.

<div class="content-wrap">                <h1>hahaah</h1>                <h1>hahaah</h1>                <p>xixi1</p>                <p>xixi2</p>                <p>xixi3</p>                <p>xixi4</p>            </div>
Copy after login

.content-wrap p:nth-child(3) {
color:red;
}

The one that turns red is xixi1

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!