CSS를 삽입하는데에는 3가지 방법이 있다,
1. 외부 스타일 시트
2. 내부 스타일 시트
3 인라인 스타일 시트
1. 외부 스타일 시트
- 전체 웹사이트의 디자인을 변경할 수 있다.
- 각각의 페이지에 HEAD에 참조주소를 입력해야한다,
예제
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
mystle.css 내용구성은 아래와 같다
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
div {
background: orangered;
width: 100vw;
height: 100vh;
margin: auto;
font-size: 50vw;
text-align: center;
}
h1 {
font-size: 25.0vw;
}
h2 {
font-size: 15.0vw;
}
h3 {
font-size: 8.0vw;
}
p {
font-size: 2vmin;
}
2. 내부 스타일 시트
하나의 페이지가 독특한 스타일을 가졌을 때 사용할 수 있다,
<head>
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
3 인라인 스타일 시트
하나의 요소가 독특한 스타일을 가졌을때 사용할 수 있고, 예제는 아래와 같다.
<h1 style="color:blue;margin-left:30px;">This is a heading.</h1>
추가: viewport 활성화 메타태그
<meta name="viewport" content="width=device-width, initial-scale=1">
'Computer > Programing' 카테고리의 다른 글
텍스트 분석 후 특정파일만 출력 (0) | 2019.02.07 |
---|---|
Snoopy 이용법해서 파싱 방법 (0) | 2019.02.07 |
텔레그램 봇 TelegramBotPHP 활용 ( 문자 및 사진보내기 ) (0) | 2019.02.07 |
Mysql 입력 출력 (0) | 2019.02.07 |
Parsing - PHP (0) | 2019.02.07 |
접속한 사용자의 IP 주소 기록 php (0) | 2019.02.07 |
스마트폰으로 접속시 특정 사이트로 이동 소스 Javascript (0) | 2019.02.07 |
정규식 (0) | 2016.06.23 |