오늘은 css에 대해 더 배웠다
우선 원래 html에서는
<h1><a href="index.html"><font color="red">WEB</font></a></h1>
<ol>
<li><a href="1.html"><font color="red">HTML</font></a></li>
<li><a href="2.html"><font color="red">CSS</font></a></li>
<li><a href="3.html"><font color="red">Javascript</font></a></li>
</ol>
이렇게 적었는데 css를 사용하고 나선
<style>
a {
color:black;
text-decoration: none;
}
</style>
<h1><a href="index.html">WEB</a></h1>
<ol>
<li><a href="1.html">HTML</a></li>
<li><a href="2.html">CSS</a></li>
<li><a href="3.html">Javascript</a></li>
</ol>
이렇게 적었다
우선 <style></style>
이 안에서 css를 넣을 수 있다
위의 코드에서 a
는 selector로 지정자이다
모든 a태그를 어케 해버릴 수 있는 그런거?
그리고 그 안에color:black
은 선언이다 a태그를 이렇게 해주세요 !! 이런거
color:black
에서 color
은 속성(property)이고 black
은 값(value)이다
그리고 밑줄을 사라지게 하는 속성도 배웠다
<style>
a {
text-decoration: none;
}
</style>
이것이드아
그리고 저렇게 지정자 안에다가 말고 따로따로 속성값을 지정하고 싶다면
<h1><a href="index.html">WEB</a></h1>
<ol>
<li><a href="1.html">HTML</a></li>
<li><a href="2.html" style="color:red;text-decoration: underline">CSS</a></li>
<li><a href="3.html">Javascript</a></li>
</ol>
이렇게 2.html 처럼 하면 된다.
style
을 붙이고 color 값과 text 속성을 넣어주면 되는 것!