css 기초 공고한 선택기
좀 더 노력하면 생활이 더 좋아질 거야...
만약 이 문장 중에 무슨 잘못된 점이 있다면 반드시 지도해 주십시오. 동생은 감격해 마지 않습니다.동시에 이 글이 나와 같은 풋내기에게 어느 정도 도움이 되었으면 좋겠다.
소스 코드 실행 효과 표시:http://sandbox.runjs.cn/show/jl74m4es
html 코드:
<div class='ClassName'> :"."+ .eg:---.className{……}</div>
<div id="IDName">ID :"#"+idName。eg:-------#IDName{……}</div>
<h1> : ( ) .eg----------h1{……}</h1>
<h2> : +","+n +{},eg:----h2, .group{……}</h2>
<div class="group"> : +","+n +{},eg:----h2, .group{……}</div>
<p class=""> : [+ +]{},eg:---p[class]{}, , p , class </p>
<div class="p">
<p class=""> : [+ +]{},eg:---<strong>.p</strong>[class]{}, ,class='p' , class </p>
</div>
<input type="text" value=" : [' '=' ']{},eg:----input[type='text']{}">
<ul class="parent">
<li> : +" "+ {}。eg:----.parent li{}</li>
<li> , ul class='parent', .parent li{}, : 。 , 。 , </li>
</ul>
<ul class="parent01">
<li> : +" > "+ {}。eg:----.parent01 > li{}</li>
<li> , ul class='parent', .parent01 > li{}。 : , , , ( , ),</li>
</ul>
<h1> h1 </h1>
<h6 class="h6"> : + {},eg:--------h1 + .h6{}, ,h1 class h6 </h6>
<a href="javascript:void(0)" class="a1"> ::link, </a>
<a href="#" class="a2"> ::visited, </a>
<a href="#" class="a3"> ::hover, </a>
<a href="javascript:void(0)" class="a4"> ::active, </a>
<input type="text" class="input" value=" ::focus">
<p class="p01"> ::before/:after. , 。eg:------.p01:before{}</p>
<ul class="parent03">
<li> ::first-child, .eg:-----.parent03 > li:first-child{}</li>
<li> li </li>
<li> ::last-child, 。.parent03 > li:last-child{}</li>
</ul>
<ul class="parent04">
<li>css3 ::first-of-type, .eg:-----.parent03 > li:first-of-type{}</li>
<li>css3 ::nth-child(n), n .eg:-----.parent03 > li:nth-child(2){}</li>
<li> </li>
<li>css3 ::last-of-type, .eg:-----.parent03 > li:last-of-type{}</li>
</ul>
css 코드:*{margin:0;padding:0}
body{overflow-x:hidden;padding-bottom:50px}
.ClassName{height:50px;margin-top:30px;color:#fff;line-height:50px;text-indent:50px;background-color:#454545}
#IDName{height:50px;margin-top:30px;line-height:50px;text-indent:50px;background-color:#f47920}
h1{height:50px;margin-top:30px;line-height:50px;text-indent:50px;background-color:#905a3d}
h2,.group{height:50px;margin-top:30px;line-height:50px;text-indent:50px;background-color:#8f4b2e}
p[class],.p[class][alt]{height:50px;line-height:50px;text-indent:50px;margin-top:30px;background-color:#5f3c23}
input[type="text"]{width:100%;height:50px;margin-top:30px;text-indent:50px;font-size:30px;border:0;background-color:#757522}
.parent,.parent01{list-style:none;margin-top:30px;padding-bottom:15px;overflow:hidden;background-color:#80752c}
.parent li{height:100%;line-height:50px;margin-top:15px;margin-left:15px;margin-right:15px;background-color:#454926;text-indent:35px}
.parent01>li{height:100%;line-height:50px;margin-top:15px;margin-left:15px;margin-right:15px;background-color:#b7ba6b;text-indent:35px}
h1+.h6{height:50px;font-size:16px;line-height:50px;text-indent:50px;margin-top:30px;background-color:#2e3a1f}
a{display:block;height:50px;text-indent:50px;line-height:50px;margin-top:30px;text-decoration:none}
.a1:link{color:#fff;background-color:#5e005e}
.a2:link{color:#fff;background-color:#7b7b7b}
.a2:visited{color:#000;background-color:#ea0000}
.a3:link{color:#000;background-color:#ff0080}
.a3:hover{color:#fff;background-color:#921aff}
.a4:link{color:#000;background-color:#ff0080}
.a4:active{color:#fff;background-color:#921aff}
.input:focus{background-color:#be77ff}
.p01{height:50px;line-height:50px;text-indent:50px;background-color:#9f35ff}
.p01:before{content:' css ';background-color:#c1c1c1}
.parent03,.parent04{list-style:none;margin-top:30px;padding-bottom:15px;overflow:hidden;background-color:#80752c}
.parent03>li,.parent04>li{height:100%;line-height:50px;margin-top:15px;margin-left:15px;margin-right:15px;background-color:#b7ba6b;text-indent:35px}
.parent03>li:first-child{background-color:#f0f}
.parent03>li:last-child{background-color:#be77ff}
.parent04>li:first-of-type{background-color:#adadad}
.parent04>li:last-of-type{background-color:#606060}
.parent04>li:nth-child(2){background-color:#b15bff}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
장치 너비가 특정 너비보다 크고 특정 너비보다 작을 때 웹 페이지 CSS 스타일을 변경하는 방법은 무엇입니까?장치 너비가 특정 너비보다 크고 특정 너비보다 작을 때 웹 페이지 CSS 스타일을 변경하려면 @media의 미디어 쿼리 구문을 사용한 다음 구문을 작성하여 스타일의 최소 너비를 정의해야 합니다. 적용된 후 and라는...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.