[Front-end] CSS notes - What is CSS

First, what is the CSS

  • Cascading Style Sheets (Cascading Style Sheets)
  • Style: How to display HTML elements
  • Stack: style-priority, high priority conflict to prevail

Can be seen from the definition, CSS syntax unit is a style that specifies how to display HTML elements

Two, CSS style composition

Two main parts: a selector, and one or more declarations
FIG
Here Insert Picture Description
interpretation FIG.
Here Insert Picture Description

Third, for example

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			body{
				/*body中字体大小*/
				font-size: 24px;
			}
			p{
				/*p标签背景颜色为黄色*/
				background-color: yellow;
			}
		</style>
	</head>
	<body>
		<p>我是一个段落标签</p>
	</body>
</html>

display effect
Here Insert Picture Description

He published 198 original articles · won praise 94 · views 90000 +

Guess you like

Origin blog.csdn.net/shang_0122/article/details/104819935