当前位置:网站首页>DW basic course (II)
DW basic course (II)
2022-04-23 21:22:00 【Programmer's simplicity】
1. In the last chapter, we learned about what is html file , So in this chapter, we will explain css The rules , So html Add style to , Every html There is a style sheet , It can be used css To set these attributes involves different aspects of element display , For example, the font of text content 、 Sub number and color , The location of element attributes, etc .CSS Is a first choice HTML Elements , Then set the selected element CSS Property mechanism .CSS The selector and the style to be applied form a line CSS The rules .
2.CSS What are the rules ?
Let's list below , Let's give a list of instructions. We set the paragraph label to blue
HTML Code
- <p> This is the paragraph tag </p>
CSS Code
- 1.p{
- 2. color: blue;
- 3.}
Browser rendering

3. Open the style sheet in the browser and press F12 You can view it in the browser HTML The structure and CSS style .
4. Complete code
- <!doctype html><!-- It is html5 Standard web statement -->
- <html><!-- Root element -->
- <head><!-- Head -->
- <meta charset="utf-8"><!-- The character set is uft-8-->
- <title> Untitled Document </title><!-- title -->
- <link rel="stylesheet" href="Untitled-3.css">
- </head>
- <body>
- <!-- This is the web content -->
- <p> This is the paragraph tag </p>
- </body>
- </html>
5.CSS Basic grammar
CSS Is a programming language , Since it is a language, there must be its grammatical rules . So next we're going to learn CSS The basic rules of grammar .
CSS The rules consist of two parts : Selector and Statement Two parts , The selector refers to the element you want to change the style , Declaration refers to the style part you need to set . The declaration consists of two parts : Properties and attribute values .

Important note :CSS and HTML The symbols in are all in English , For example, in the rule ":" Colons and ";" A semicolon .
For the basic structure above , We can make the following extensions :
6. Multiple declarations are contained in one rule
- p {
- color:blue;/* Font color style */
- font-size: 18px;/* Font size style */
}
7. Multiple selectors are combined
for example : At the same time, label the title h1 h2 h3 Set the same style properties
- <h1>hello world</h1>
- <h2>hello world</h2>
- <h3>hello world</h3>
8.CSS The rules :
- h1,h2,h3{ /* Between selectors , The English status is separated by commas */
- color: blue; /* Font color style */
- font-size: 20px;/* Font size style */
- }
9. Multiple rules apply to a selector
In a nutshell , multiple CSS A rule to change the style of an element .
- h1,h2,h3{ /* Between selectors , The English status is separated by commas */
- color: blue; /* Font color style */
- font-size: 20px;/* Font size style */
- }
- h1{
- text-align: center;/* The text content is centered */
- }
10. For the top 2 Bar rule ,H1 The final style of the label is , The font color is blue , Font size: 20 Pixels , The text content is centered .
版权声明
本文为[Programmer's simplicity]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/110/202204200620389952.html
边栏推荐
- Norm normalization in tensorflow and pytorch of records
- Opencv reports an error. Expected PTR < CV:: UMAT > for argument '% s'‘
- Common commands of MySQL in Linux
- Addition, deletion, modification and query of MySQL advanced table
- Pytorch selects the first k maximum (minimum) values and their indexes in the data
- 亚马逊和Epic将入驻,微软应用商城向第三方开放
- Explore ASP Net core read request The correct way of body
- Thinking after learning to type
- Is qiniu school useful and is the recommended securities account safe
- Introduce structured concurrency and release swift 5.5!
猜你喜欢

Lunch on the 23rd day at home

Arm architecture assembly instructions, registers and some problems

Zhongchuang storage | how to choose a useful distributed storage cloud disk

3-5 obtaining cookies through XSS and the use of XSS background management system
![[leetcode refers to the two numbers of offer 57. And S (simple)]](/img/c2/7c1434e3c0bbcc6d6364361c3a3ab4.png)
[leetcode refers to the two numbers of offer 57. And S (simple)]
![[leetcode refers to offer 42. Maximum sum of continuous subarrays (simple)]](/img/e9/497a31cd70b9b21e4cb7845b688d18.png)
[leetcode refers to offer 42. Maximum sum of continuous subarrays (simple)]

Deno 1.13.2 发布

Another data analysis artifact: Polaris is really powerful

Addition, deletion, modification and query of advanced MySQL data (DML)

Mysql database common sense storage engine
随机推荐
IOT 设计与开发
Reentrant function
Ubuntu 20 installing centernet
C knowledge
Deep analysis of C language pointer (Part I)
Graph traversal - BFS, DFS
PHP的Laravel与Composer部署项目时常见问题
Pytorch selects the first k maximum (minimum) values and their indexes in the data
[leetcode refers to offer 21. Adjust the array order so that odd numbers precede even numbers (simple)]
Go limit depth traversal of files in directory
Zhongchuang storage | how to choose a useful distributed storage cloud disk
Selenium 显示等待WebDriverWait
阿里又一个“逆天”容器框架!这本Kubernetes进阶手册简直太全了
MySQL advanced common functions
Win 11K in 100 days, super complete learning guide for job transfer test
Normalized transforms in pytorch The real calculation process of normalize
100天拿下11K,转岗测试的超全学习指南
Prim、Kruskal
Thinkphp5 + data large screen display effect
【SDU Chart Team - Core】SVG属性类设计之枚举