When you're browsing the web , Have you ever thought about such a problem : How to make a web page ? Making a web page is very simple , Just know what it is HTML And master HTML You can make a simple web page with the basic knowledge of , Today I'm going to talk about HTML The introduction and structure of .
One 、 What is? HTML?
1、 Before we start to learn HTML Before we need to know what is HTML?
HTML The full name is Hyper Text Markup Language, The Chinese name is hypertext markup language , The reading mode is web browser , meanwhile HTML Also known as web pages .
2、 A simple HTML file
Two 、HTML Editor
We can use TXT Text documents or professional HTML Editor to edit HTML.
1、 Notepad
① Create a TXT Text
② Input HTML Code
③ Click on the file — Save as — Enter a name +“html” You can get your first HTML file .
④ Then double-click the file to run .
Running results
2、 Professional editor
① Sublime Text
② HBuilder
③ Adobe Dreamweaver
④ CoffeeCup HTML Editor
I recommend HBuilder This editor , Simple interface , Editing is quick .
3、 ... and 、HTML Component part
In the case above, we can see that HTML It's from the head (head) And the body (body) Made up of .
1、 Head (head)
Usually contains a title (title), It's the name of a web page
Webpage title
2、 The body (body)
body The content section is an important part of the whole web page , Let people browse the content of this webpage at a glance , You can insert text 、 picture 、 Multimedia and so on .
Four 、HTML Elements
l HTML Element means starting with the start tag , Elements terminated with an end tag : The element content is the content between the start tag and the end tag .
l <head></head>、<body></body>、<p></p>、<h1></h2> Wait, these are all HTML Elements , In the case above, there are six elements .
l There are also some elements with only the start tag , for example <br>, End with the end of the start tag .
5、 ... and 、HTML Properties of
l Generally speaking HTML And the property of that is HTML Attribute of element , Attribute can add additional information to the element .
l Property is always named / The form of value pairs appears , such as :name=”value”.
l Properties are generally described in the start tag .
l style There will be more attributes in .
6、 ... and 、HTML format
HTML Many elements can be defined for formatting output , Like bold and italics .
HTML Text formatting labels
label |
describe |
<b> |
Define bold text |
<em> |
Definition emphasis text |
<i> |
Define italics |
<small> |
Define small print |
<strong> |
Defining accentuation |
<sub> |
Define subscript |
<sup> |
Definition superscript |
<ins> |
Define caret |
<del> |
Define delete words |
Diagram of operation results
HTML“ Computer output ” label
label |
describe |
<code> |
Define computer code |
<kdd> |
Define keyboard code |
<samp> |
Define computer code samples |
<var> |
Defining variables |
<pre> |
Define pre formatted text |
HTML a citation 、 Reference and label definition
label |
describe |
<abbr> |
Define abbreviation |
<address> |
Define address |
<bdo> |
Define text direction |
<blockquote> |
Define long references |
<q> |
Define short Quotes |
<cite> |
Define the reference 、 Citation |
<dfn> |
Define a definition item |
7、 ... and 、HTML Hyperlinks
Hyperlinks can be images 、 written words 、 Multimedia can also be a website
Example :
result :
Click on the underlined two words to enter the website of a certain degree
8、 ... and 、HTML CSS
1、CSS It's a cascading style sheet , Can be modified html Element style and can be accurately typeset
2、CSS There are three ways :
l Internal style , stay HTML Use... In elements “style” attribute
l Internal style sheets , In the head <head> Area use <style> Element to contain CSS
l External reference , Reference with suffix css The file of , Example :
html file
css file
If you see this , It means that you have opened the door to making web pages ~