JavaScript 5일차 - CSS기초 2

2021. 12. 23. 15:14코딩공부/JavaScript

CSS기초 2

 

- style 태그

 

선택자

<div>태그 : css를 입히기 위해 아무 의미도 기능도 없이 제어를 위해 감싸주는 태그 / 줄바꿈 있음

<span>태그 : 위와 동일/ 줄바꿈 없음

 

css text bold를 검색해보자

https://www.w3schools.com/cssref/pr_font_weight.asp

 

CSS font-weight property

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

<span style="font-weight: bold;">고용보험</span>

 

만약 html문서중 1억개가 들어가있는 어떤 특정 단어의 스타일을 일괄적으로 바꾸고싶다면?

<style>태그 : 안의 내용이 css다라고 웹브라우저에게 알려주는 구분자

<span class="js">실업급여</span>

로 묶어주고 스타일 태그 안에 js를 사용하여  일괄적으로 바꿀 수 있다.