반응형
HTML의 <style> 태그는 텍스트 형식, 색상, 레이아웃 등 HTML 문서의 요소에 스타일을 적용하는 데 사용된다.
<style> 태그는 일반적으로 HTML 문서의 <head> 섹션에 배치되며, 전체 문서 또는 문서의 특정 섹션에 대한 스타일을 정의하는 데 사용할 수 있다.
다음은 <style> 태그를 사용하는 방법의 예입니다:
<!DOCTYPE html>
<html>
<head>
<style>
/* define styles here */
body {
background-color: #f0f0f0;
}
h1 {
color: blue;
text-align: center;
}
</style>
</head>
<body>
<h1>Welcome to my website</h1>
<p>This is some text on my website.</p>
</body>
</html>
<style> 태그 내에서 정의된 CSS 스타일은 HTML 문서의 <body> 섹션에 있는 요소에 적용됩니다.
본문 요소의 배경색은 #f0f0f0이고 h1 요소의 색상은 파란색이며 텍스트는 가운데에 정렬된다.
<link> 태그를 사용하여 CSS 파일을 HTML 문서에 연결하여 외부적으로 스타일을 포함할 수도 있다:
<head>
<link rel="stylesheet" type="text/css" href="path/to/styles.css">
</head>
You can use the <style> tag to customize the appearance of your web page and make it
반응형
'HTML' 카테고리의 다른 글
display 속성 (0) | 2023.01.25 |
---|---|
<table> <tr> <td> 태그 (0) | 2023.01.25 |
<h1>, <h2>, <h3> ..<h6>태그 (0) | 2023.01.25 |
<a href="..."> 앵커태그 (0) | 2023.01.25 |
<form> <input> <select> <textarea> 태그 (0) | 2023.01.25 |
댓글