Home  >  Article  >  Web Front-end  >  Basic use of html (explanation of HTML tags)

Basic use of html (explanation of HTML tags)

高洛峰
高洛峰Original
2017-02-13 14:08:341455browse

The most basic HTML tags: link, FRAMES, span, p and style sheet css, all of which must be learned before you can hand-write HMTL code.

1. Links
Hypertext links in HTML are very important. The basic format is as follows:
Link Text

1. Local link
①Absolute Road King:
Absolute Road King links to local pictures
②Relative Road Jin
Relative Road Jin links to local pictures
③Links to the upper level directory
Link to the upper-level directory

2. URL link
Format: protocol name://host.domain name/roadjin/file Name
protocols include:
file Local system file
http WWW server
ftp ftp server
telnet TELNET-based protocol
mailto Email
news Usenet news group
gopher GOPHER server
wais WAIS server
Such as: Baidu

3. Directory link
First set a certain paragraph as the link position, the format is:

Then call the file of this link part and define the link:
Link text
Of course, if you jump within a file, the file name can be omitted.

2. Multi-view window FRAMES
HTML files designed using the FRAMES structure can divide the entire window into several independent small windows. Each small window can load different files and can communicate with each other.
1. Basic structure:







...


2. Size setting of each window
We divide the window into several pieces, using the ROWS attribute for horizontal division and the COLS attribute for vertical division. The size of each piece can be realized by the values ​​of these two attributes. The value of


# is a pair of strings enclosed in quotation marks. The number in the string represents the occupancy of each window. The sizes are separated by commas, and the numbers can also be replaced by "*" to indicate that the browser automatically allocates the size. For example,


3. Interoperation between windows
①The src attribute of the frame is used to specify the content to be linked, the name attribute specifies the name of the window, and the target attribute is used to specify the link In which window the file appears, the value can be the name defined by name, or the following four types of values:
Display a new window
Displayed in the same window
Displayed in the window of the previous file in Frameset
Displayed in the entire browser Other attributes of the window
②frame
#=yes,no
frameborder specifies the setting of the border of each window: yes means there is a border, no means no border
## The value of #
# is pixels. This property is used to set the width of the upper, lower, left and right borders of the window. If not set, it will be automatically determined by the browser.

#=yes,no,auto
Scroll bar settings, yes means yes, no means no, auto means automatically set by the browser, the default value is auto.


The noresize attribute specifies that the user cannot resize the frame. By default, frames can be resized by dragging the "walls" between them, and this property locks the size of the frames.


3. Style sheet
1. The most important role of the style sheet is to provide a method to keep the style of all web pages consistent.
The three levels of style sheets, in order from low level to high level, are:
①.Built-in (inline) style sheet: applicable to the content of a single element
②.Document level (document level) style sheet : Applicable to the main body of the entire document
③. External (external) style sheet: Can be applied to the main body of multiple documents
When used, if a conflict occurs, the low-level style sheet has priority in use .
2. Issues you need to pay attention to when using CSS:
①Some browsers may not support certain attribute values. In this case, the browser will either ignore these attribute values ​​or replace them with an optional value.
②The built-in style only adapts to a single element, which actually violates the original design intention of the style sheet, so it should be used with caution.
③Document level style description appears in the header of the document and applies to the entire body of the document. Therefore, this is how the overall style of website construction can be kept consistent.
④The external style sheet is not part of the document in which it is used. The external style sheet needs to be stored separately and must be explained when using it. External style sheets can be written into some text files using the MIME type text/css. They can be stored in any computer on the Internet. The browser obtains the external style sheet just like obtaining the document. The element at the head of a web page can also be used to specify an external style sheet. In , the rel attribute is used to specify the relationship between the linked document and the document containing the link, and the href attribute is used to specify the style. The URL address of the table document. Such as


4. span and p
Usage of
In some cases, some special font attributes are required to be applied only to part of the text of the entire paragraph, such as setting a certain word or phrase to a different font or background. etc. This is where you can use the element, for example:

I likeProgramming< /span>, this is a very pleasant thing.



Usage
In web pages, sections are a very common form. Each section is composed of several paragraphs. If in the design, it is hoped that not only each paragraph, Instead, you can style sections in a web page. At this time, you can use

. Its main purpose is to specify the appearance display details of a certain section or area in the web page.

For more articles related to the basic use of html (explanation of HTML tags), please pay attention to the PHP Chinese website!