This article mainly introduces the HTML knowledge that must be learned for front-end development, and introduces the basic technologies that need to be mastered to learn web front-end development. Interested friends can refer to
1 Introduction to HTML
1.1 First experience with coding, making the first web page
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>制作我的第一个网页</title> </head> <body> <h1>Hello World</h1> </body> </html>
1.2 The relationship between HTML and CSS
To learn the basic technologies of web front-end development, you need to master: HTML, CSS, JavaScript language. Let's take a look at what these three technologies are used to achieve:
1. HTML is the carrier of web page content. Content is the information that web page creators put on the page for users to browse, and can include text, pictures, videos, etc.
2. CSS style is performance. It's like a coat for a web page. For example, title font, color changes, or adding background images, borders, etc. to the title. All these things used to change the appearance of content are called presentations.
3. JavaScript is used to implement special effects on web pages. For example: the drop-down menu pops up when the mouse slides over it. Or the background color of the table changes when the mouse rolls over it. There is also a rotation of hot news (news pictures). It can be understood that animation and interaction are generally implemented using JavaScript.
The following code demonstrates the effect of CSS. HTML is used to represent web page elements. CSS makes elements more expressive, such as element position, size, color, font, etc.:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Html和CSS的关系</title> <style type="text/css"> h1{ font-size:19px; color:#930; text-align:center; } </style> </head> <body> <h1>Hello World!</h1> </body> </html>
( 1) Line 8 of code affects the text size of the window.
(2) Line 9 of code affects the change of window text color.
(3) Line 10, changes that affect the centering of window text.
1.3 Understanding HTML tags
Various web pages are composed of html tags. The following is a simple web page:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>认识html标签</title> </head> <body> <h1>勇气</h1> <p>三年级时,我还是一个胆小如鼠的小女孩,上课从来不敢回答老师提出的问题,生怕回答错了老师会批评我。就一直没有这个勇气来回答老师提出的问题。学校举办的活动我也没勇气参加。</p> <p>到了三年级下学期时,我们班上了一节公开课,老师提出了一个很简单的问题,班里很多同学都举手了,甚至成绩比我差很多的,也举手了,还说着:"我来,我来。"我环顾了四周,就我没有举手。</p> <img src="http://img.imooc.com/52b4113500018cf102000200.jpg" > </body> </html>
The effect is as follows:
Analyze this web page What HTML is composed of:
(1) "Courage" is the title of the web content article,
When I was in third grade... I didn't have the courage to participate.
1.4 Label syntax
1. A label is enclosed by English angle brackets < and >, such as a label. Tags in
2.html generally appear in pairs, divided into start tags and end tags. The closing tag has one more / than the opening tag.
3. The tag structure diagram is as follows:
4. Tag examples:
(1)
5. Tags can be nested. But the order must be consistent. For example:
is nested in
, then
must be placed in front of . As shown below.7. Test: There is a web page code, but the 9th line is missing the code, please add:
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>标签的语法</title> </head> <body> <h1>在本教程中,你将学习如何使用 HTML 来创建站点</h1> <p>当特殊的样式需要应用到个别元素时,就可以使用内联样式。 </body> </html>
1.5 html/head/body understand HTML Basic file structure
Learn the structure of html files: An HTML file has its own fixed structure.<html> <head>...</head> <body>...</body> </html>
代码讲解:
1. 称为根标签,所有的网页标签都在中。
2.