2020. 7. 4. 19:19ㆍstudy/TIL
HTML style tag
https://www.freecodecamp.org/news/inline-css-guide-how-to-style-an-html-tag-directly/
Inline CSS Guide – How to Style an HTML Tag Directly
You’ve written some HTML and now need to style it with CSS. One way is to use inline styles, which is what this article is about.
This is my first paragraph.
Before we jump into the nuances of inline styles—w
www.freecodecamp.org
링크를 이용해서 외부 CSS stylesheet을 사용하는것 말고도
html에 직접 <style> 태그를 이용해서 css 규칙을 적용하는 방법 도 있다 .
Internal stylesheet 을 사용하는 방법과 Inline style 을 사용하는 방법 이렇게 두가지.
<Internal stylesheet >
<head>
<style>
p {
color: red;
font-size: 20px;
}
</style>
</head>
head 태그 안에 따로 style 태그를 만들어준다 .
그안에 어떤태그에 스타일을 적용할것인지 중괄호를 이용해 표현해준다 .
<Inline styles>
<p style="color: red; font-size: 20px;">This is my first paragraph.</p>
<p>This is my second paragraph.</p>
위의 Internal stylesheet 과 적용하는 스타일은 같다.
다만 태그안에 바로 ' = ' 등호를 이용하여 한줄로 나타내준다.
HTML script tag
html 에 javascript를 넣어주기 위한 방법이다.
<script> 태그를 써주면 그 안에 있는 내용은 자바스크립트로 읽어낸다 .
https://opentutorials.org/course/3085/18778
HTML과 JavaScript의 만남 1 (script 태그) - 생활코딩
소스코드 변경사항
opentutorials.org
'study > TIL' 카테고리의 다른 글
JavaScript array - push () , pop() , slice() , splice() (0) | 2020.07.07 |
---|---|
Document. querySelector() (0) | 2020.07.05 |
Javascript - event listener/ addEventListener (0) | 2020.07.05 |