head The contents of the element are “ Metadata ”( Metadata : Data that describes data )
)title Elements : The title of the page
title Elements : The title of the page
)meta Elements : Character encoding of web pages
meta The element is used for Set the character encoding of the web page , No setting or wrong setting will lead to garbled code
stay HTML5 Before ,meta The writing of labels is also more complex
The elements listed below are mostly in head Element internal use :
meta
title
style
link
base
script
noscritpt
)base Elements : Set up a The default behavior of the element
base The element is used for Set all settings for the current page a The default behavior of the element ;base The elements are written in head In the elements
body Elements : The specific content and structure of the web page
body The content in the element is what you see in the browser window , That is to say The specific content and structure of the web page
Official documents are the most authoritative references , You can see HTML5 All relevant information
HTML5 Code specification detector :https://validator.w3.org/
h、p、strong Elements : Text style
h The element represents The title of the page (h1 ~ h6 There is a total stipulation that 6 The title of a level )
h Elements and SEO
h Elements contribute to the website's SEO (Search Engine Optimization) Optimize , Can promote keyword ranking
It is recommended that there be at most 1 individual h1 Elements
Misuse h Elements not only don't bring good weight to the website , At the same time, it may also be considered cheating by search engines , Finally lead to K standing
p Elements Represents a paragraph in an article (paragraph)
strong The element is used for Emphasize certain texts , Bold display effect
pre、code、br Elements : Structural pattern
By default ,HTML Most spaces in the code are compressed by the browser
If you want to Keep all HTML Space in the code 、 Line break , have access to pre Elements
code The element is used for Display program code
br The element is Single label , Express Forced line wrap
Character entities : Show special symbols
HTML Some characters are reserved for special purposes , Like the less than sign <
、 More than no. >
To display these reserved characters correctly in the web page , Character entities must be used , The writing format is generally 2 Kind of :
&entity_name;
&#entity_number;
Common character entity :
Space :
More than no. :>
Less than no. :<
&:&
img Elements : display picture
img The element is specifically used to display picture (img yes image Abbreviation )
src Property is used to set the path of the picture (URL)
Absolute path : Full path describing the file location
Relative paths : The path relationship with other files caused by the folder where this file is located
.
Represents the current folder , It can be omitted
..
Represents the parent folder
For web pages , No matter what operating system , Path separators are /
, No \
Be careful :
img If the element is only set width
, The browser will automatically calculate... According to the image aspect ratio height
width
Empathy
stay HTML5 Specification ,alt
yes img The necessary attributes of the element
width
、height
The default unit for is px( Pixels )
) Pictures and pixels
web The commonly used picture formats are :
png: static picture , Support transparency
jpg: static picture , Transparency is not supported
gif: The dynamic image 、 static picture , Support transparency
Pixels :
Pixels (px) Is the smallest unit of image display
Each pixel can represent a color
The images displayed by the computer are composed of a pile of pixels
The more pixels make up the picture , The clearer the display
The usual screen resolution , It's usually in pixels :
a Elements : Define hyperlinks
a The role of elements : Define hyperlinks , Used to open a new URL
Common properties
href
: Specify the... To open URL
Hypertext Reference For short
target
: Where to open URL
target
There are the following values
_self
: The default value is , Open... In the current window URL
_blank
: Open in a new window URL
_parent
: Open... In the parent window URL
_top
: Open... In the top window URL
Some frame Of name value : In a certain frame Open in URL
reflection :a Element must be used to jump to a new page ?
href
Properties will cause different effects )iframe Elements : The embedded HTML file
iframe Elements can implement : In a HTML Embed other in the document HTML file
frameborder
Property is used to specify whether a border is displayed :1
- Show 、0
- No display
) Anchor link : Jump in the web page
Anchor links can achieve : Jump to a specific location in the web page
Click on go It will be positioned to :
id
The value is one
Any element of
name
The value is one
Of a Elements
If href="#"
After clicking, it will Go back to the top of the current page
Using the above methods can Jump to the specified location on another page
) Pseudo link : Click not to jump URL
Pseudo link : Links that do not specify a specific link address
Sometimes clicking on a link doesn't want to open a new URL, But want to do something else , You can use Pseudo link
What do you want to do after clicking the link , The corresponding JavaScript Code
If you don't do anything for the time being , You can write it in the following form :
So sometimes you can use links as buttons
) Picture links
img Element heel a Elements used together , Can realize picture link
======================================================================
Browser access https://www.baidu.com/img/bdlogo.gif The process of :
What is? URL?
URL The full name is Uniform Resource Locator( Uniform resource locator )
URL It's the address of the resource 、 Location , Every resource on the Internet has a unique URL
adopt 1 individual URL, Can find the only one on the Internet 1 A resource
URL The basic format of = protocol://hostname/path
= agreement :// The host address / route
URL Common protocols :
http: Hypertext transfer protocol , Access to remote network resources , The format is http://
http Protocol is the most commonly used protocol in network development
https The agreement is equivalent to http Secure version of the protocol
file: Access to resources on the local computer , The format is file://
( No need to add the host address )
mailto: It's an email address , The format is mailto:
ftp: Access the file resources of the shared host , The format is ftp://
ed2k: By supporting ed2k( Dedicated download link ) Agreed P2P Software access to the resource , The format is ed2k://
For Software : Emule
thunder: By supporting thunder( Dedicated download link ) Agreed P2P Software access to the resource , The format is thunder://
For Software : thunderbolt
URL The more specific and complete syntax format is :
protocol://hostname[:port]/path/[;parameters][?query]#fragment
example : http://www.baidu.com:80/s?wd=ios#page
port
: Port number
One has IP The host of the address can provide many services , such as Web service 、FTP service 、SMTP Service etc.
The host by “IP Address + Port number ” To differentiate between different services , The port number is similar to the window of the business hall
Share some information to everyone , I think these are very useful things , You can also follow to learn , Leak filling .
Get the full version of : Crazy poke here to get free ~
《Java Advanced interview 》
《Java Advanced architecture knowledge 》
《 Algorithmic knowledge 》