Basic use of HTML (HTML tag interpretation) _css/html

Source: Internet
Author: User
Tags gopher

One, link
Hyperlinks in HTML are very important, and the basic format is as follows:
<a href= "Resource Address" > link text </A>

1. Local Links
① Absolute Road Strength:
<a href= "C:\images\article.jpg" > Absolute road link to local picture </A>
② relative to road strength
<a HREF = "article2.jpg" > Relative to the road link to local picture </A>
③ link to the previous level directory
<a href= ". /test.htm "> Link to previous directory </A>

2, URL link
Form: protocol Name://host. Domain name/Lu Jing/filename
The agreement includes:
File Local System files
HTTP www server
FTP FTP Server
Telnet based on Telnet protocol
mailto e-mail
News Usenet newsgroups
Gopher Gopher Server
WAIS WAIS Server
such as: <a href= "Http://www.jb51.net" > Baidu </A>

3, directory Links
First set a paragraph as a link location, in the form:
<a name= "link Location name" ></A>
Then call the file in this link section to define the link:
<a href= "FileName # Link Location name" > link text </A>
Of course, if you jump within a file, the file name can be omitted and not written.

second, multiple Windows mouth frames
HTML files that are designed using the frames structure can divide the entire window into separate small windows, each of which can load separate files and communicate with each other.
1. Basic structure:
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<FRAMESET>
<frame src= "url" >
<frame src= "url" >
...
</FRAMESET>
</HTML>
2, the size of each window set
We divide the window into several pieces, horizontally divide the rows property, and the cols attribute is used vertically, and the size of each block can be implemented by the values of the two properties.
<frameset cols=#>
<frameset rows=#>
#的值为一对用引号括起来的字符串, the number in the string represents the size of each window, separated by commas, and the number can be replaced with "*", which means that the size is automatically allocated by the browser. Such as
<frameset cols= "100,200,300" >
<frameset rows= "10%,20%,70%" >
<frameset cols= "100,*,*" > divide the window evenly beyond 100 pixels
3. Mutual operation between windows
The src attribute of the ①frame is used to specify the content to link, and the Name property specifies the window, and the target property is used to specify which window the linked file appears in, which can be the name defined by name or the following four class values:
<a Href=url target=_blank> displays a new window
<a Href=url target=_self> displayed in the same window
<a Href=url target=_parent> Display in Frameset's previous file window
<a Href=url target=_top> displayed throughout the browser window
Other properties of ②frame
<frame frameborder=#> #=yes,no
frameborder specifies the settings for the border of each window: Yes indicates a border, no indicates no border

<frame marginwidth=# marginheight=#>
#的值为像素点, this property is used to set the width of the upper and lower bounds of the window, which, if not set, is automatically determined by the browser.

<frame Scrolling=#>#=yes,no,auto
The scroll bar setting, yes indicates that no, no, auto is set by the browser automatically, and the default value is auto.

<frame noresize= "Noresize" >
The Noresize property stipulates that the user cannot resize the frame. By default, you can change the size of a frame by dragging the "wall" between frames, which locks the size of the frame.

third, style sheet
1. The most important role of the stylesheet is to provide a way to keep the styles of all Web pages consistent.
The three levels of the style sheet are in order from lower to upper level:
①. Built-in (inline) style sheet: Content that works for a single element
②. Document level style sheet: The body that works for the entire document
③. external (external) style sheet: can be applied to the body of multiple documents
When used, a low-level style sheet has precedence over usage if there is a conflict.
2. Use CSS to pay attention to the problem:
① Some browsers may not support some property values, the browser either ignores these property values or replaces them with an optional value.
The ② built-in style only fits a single element, which in fact violates the design intent of the stylesheet, so it should be used with caution.
The ③ document Layer style description appears in the head section of the document and applies to the entire body of the document. So the overall style of website construction can be consistent is the way to achieve.
④ an external style sheet is not part of the document that uses it, the external style sheet needs to be stored separately, and is described when it is used. You can use MIME type text/css to write external style sheets as text files that can be stored on any computer on the Internet, and the browser gets an external style sheet just as you would get a document. The <link> element of the page header can also be used to specify an external style sheet, in <link> where the Rel property is used to specify the relationship between the linked document and the document that contains the modified link, and the href attribute is used to specify the URL address of the stylesheet document. Such as
<link rel=stylesheet type= "text/css" href= "Themes/autotheme/style.css" ></link>

four, span and Div
Use of <span>
In some cases, some special font properties are required to apply only to part of the text in the entire paragraph, such as a font or background that is set to a different word or phrase, and so on. This is where you can use <span> elements, such as:
<p> I like <span style= "font-size:24pt;font-family: blackbody; color:red" > Programming </span> This is a very enjoyable thing. </p>

Use of <div>
In a Web page, a section is a very common form, and each section is made up of several paragraphs, and in the design, you want to make a style setting for sections in a Web page, not just for individual paragraphs. You can use &LT;DIV&GT, whose primary purpose is to specify the appearance details of a section or area in a Web page.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.