CSS 선택
span 태그 내의 class 는 그룹핑.
id 는 식별자! (중복은 가능하나 하지 말아야 함)
CSS에서
우선순위 id > class > 태그( ex_<span> ) )
#idname #으로 시작 되는 부분은 id를 선택
#idname{
css 적용 옵션
}
.classname 으로 시작되는 부분은 클래스를 선택
.classname {
css 적용 옵션
}
span 부분 모든 <span>태그 선택
span{
css 적용 옵션
}
아래 <head> 태그안의
<style> css 적용 예
<body>부분 <span>태그 내의 id, class 를 <style>태그의 css적용
------------------------------
<!doctype html>
<html lang="ko">
<head>
<style>
.js {
font-weight: bold;
color: red;
}
#first {
color: green;
}
span {
color: blue;
}
</style>
</head>
<body>
<h1><a href="index.html"> WEB</a></h1>
<h2 style="background-color:coral; color:powderblue">JavaScript</h2>
<p>
<span id="first" class="js">JavaScript</span> (/ˈdʒɑːvəˌskrɪpt/[6]), often abbreviated as JS, is a
high-level, interpreted programming language. It is
a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm. Alongside
<span>HTML</span>
and <span>CSS</span>, <span class="js">JavaScript</span> is one of the three core technologies of World Wide Web
content engineering. It is used to make
webpages interactive and provide online programs, including video games. The majority of websites employ it, and all
modern web browsers support it without the need for plug-ins by means of a built-in <span
class="js">JavaScript</span>
engine. Each of the
many <span class="js">JavaScript</span> engines represent a different implementation of <span
class="js">JavaScript</span>, all based on the ECMAScript
specification, with some engines not supporting the spec fully, and with many engines supporting additional features
beyond ECMA.
</p>
</body>
</html>
결과