[TIL] CSS 선택자

Dana·2021년 10월 26일
post-thumbnail

All about CSS

  1. CSS란 뭔가
    : Cascading Style Sheets

  2. 왜 필요한가
    : HTMl로 작성된 파일을 꾸미는 데 목적이 있다.
    : 말 그대로 Style Sheets

  3. CSS 사용법 분류

external css

  • css 전용 파일 생성해서 외부 파일 참조해서 html 작성하는 방식
  • 예) Exam.html 파일은 style.css 파일을 아래와 같이 참조한다
<link rel="stylesheet" href="style.css">

internal css

  • css 관련 내용을 html 상단부에 작성하는 방식

  • head 태그 부분에 stryle 태그를 이용해 작성한다

    (head part)
    <style>
        div{background-color: dodgerblue; 
      		color: floralwhite;}
    </style>
    
    (body part)
    <div> test </div> 
    

inline css

  • html 태그의 속성으로서 css가 작성되는 방식
<div style="background-color: dodgerblue; color: white;">abc</div>

선택자

profile
잘하는 건 아닌데 포기하지 않을 거야. 난 키가 별로 크진 않지만 농구를 포기하지 않을 거야. 쓸 데 없는 배움은 없다.

0개의 댓글