고요빛물결
CSS

CSS Tutorials For Beginners #6-10

· 2019-02-10 (일) 14:50:39 · 1110

External style sheets

인라인과 임베디는 시간 소비

빠르고 쉽게  External style로

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <title>CSS For Beginners</title>
  <link rel="stylesheet" href="styles/syntax.css">
</head>
  
<body>
  <p class="welcome">Welcome!</p>
  
  <div id="header">
    <h1>Selectors</h1>
    <h2>In CSS</h2>
    <p>Welcome to the website!</p>
  </div>
  
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>
  <p>Hello there ninjas!</p>

  <!-- Scripts -->
  <script src="scripts/index.js"></script>
</body>
</html>

contact.html

<!DOCTYPE html>
<html lang="en">
<head>
  <title>CSS For Beginners</title>
  <link rel="stylesheet" href="styles/syntax.css">
</head>
  
<body>
 <div id="header">
    <h1>Contact Us</h1>
  </div>
  
  <p>Hello there ninjas! contact us below.</p>
  <p>Hello there ninjas! contact us below.</p>
  <p>Hello there ninjas! contact us below.</p>
  <p>Hello there ninjas! contact us below.</p>
  <p>Hello there ninjas! contact us below.</p>
  <p>Hello there ninjas! contact us below.</p>


  <!-- Scripts -->
  <script src="scripts/index.js"></script>
</body>
</html>

 

syntax.css에

p{
  font-size: 12px;
  color: blue;
}

blue를 red로 12px를 20px로 바꾸면 한번에 바뀌는 것을 알수가 있습니다.

 

CSS Comments and Where to Use Them

 

/* */ 를 사용함

 

Targeting Elements with CSS

 

각각의 tag에  적용시킬수 있음

p, a, span, h1, div 태그에 적용

 

Targeting Classes and ID's

 

Class는 한페이지에서 여러번 사용이 가능하지만

id는 한페이지에서 한번만,  유일하게 사용되어야 함.

 

id를 선택하기 위해서는 # 을 class를 선택하기 위해서는 . 으로..

 

CSS Conflicts & the Cascade

 

위에서 아래로 적용됨.

뒤에 있는 규칙이 적용됨 (인라인 스타일이 마지막..)

 

댓글을 작성하시려면 로그인이 필요합니다.

소모임

23,243건
+
분류 제목 글쓴이 날짜 조회
서버관리자 19-02-12 조회 1,782
소지구 19-02-12 조회 5,998
음악/악기 19-02-12 조회 1,627
CSS 19-02-12 조회 1,295
소지구 19-02-12 조회 8,984
서버관리자
[서버관리자]
19-02-12 조회 2,245
CSS 19-02-12 조회 1,256
Git 19-02-12 조회 1,821
JS프레임워크 19-02-12 조회 1,075
JS프레임워크
[JS프레임워크]
19-02-12 조회 1,246
JS프레임워크
[JS프레임워크]
19-02-12 조회 1,316
모형취미 19-02-12 조회 1,077
출산육아 19-02-11 조회 1,050
자동차 19-02-11 조회 1,684
개발자 메모장 19-02-11 조회 3,803
CSS 19-02-11 조회 1,360
CSS 19-02-11 조회 1,067
서버관리자
[서버관리자]
19-02-11 조회 1,807
소지구 19-02-11 조회 3,642
CSS 19-02-11 조회 1,027
Git 19-02-11 조회 2,239
Git 19-02-11 조회 1,909
Git 19-02-11 조회 1,884
JS프레임워크
[JS프레임워크]
19-02-11 조회 1,109
JS프레임워크 19-02-11 조회 1,152
JS프레임워크 19-02-11 조회 1,103
해외사용자 19-02-10 조회 1,411
CSS 19-02-10 조회 1,111
소지구 19-02-10 조회 3,201
Git 19-02-10 조회 2,021