Summary of common html elements

Source: Internet
Author: User

1. Basic Structure:
<! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
<Title> </title>
</Head>
<Body>

</Body>
</Html>
2. Document Type:

(1) HTML 4.01

<! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN" "http://www.w3.org/TR/html4/loose.dtd">


(2) HTML5

<! DOCTYPE html>


(3) XHTML 1.0

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

3. header:

(1) Character Set

<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">

(2) Introduce JS

<Script language = "javascript"> </script>

<Script language = "javascript" src = ""> </script>

<Script language = "javascript"> var u = "_ URL _"; var a = "_ APP _"; </script>
<Script language = "javascript" src = "_ PUBLIC _/js/jquery-1.8.1.min.js"> </script>

(3) Introduce CSS

<Style type = "text/css"> </style>

<Link rel = "stylesheet" href = "" type = "text/css">

(4) set the default redirect

<Base href = ""/>

<Base target = "_ blank"/>

(5) set search engine information

<Meta name = "description" content = ","/>
<Meta name = "keywords" content = ","/>

4. Subject:

(1) Basic Content

<Body onload = "">

<Div id = "" class = ""> </div>

<Div style = "clear: both;">

(2) Form

GET method submission: <form id = "" action = "" method = "post"> </form>
POST submission: <form id = "" action = "" method = "get"> </form>

Submit with file: <form id = "" action = "" method = "post" enctype = "multipart/form-data"> </form>


Homepage frequently used:

<Input id = "username" name = "username" class = "" type = "text" placeholder = "username"> </input>
<Input id = "password" name = "password" class = "" type = "password" placeholder = "password"> </input>
<Input id = "login_button" class = "button" type = "button" value = "Logon" onclick = ""> </input>
<Input id = "register_button" class = "button" type = "button" value = "register" onclick = "location. href ='' ">


Text Field: <input id = "" name = "" class = "" type = "text"> </input>

Password Field: <input id = "" name = "" class = "" type = "password"> </input>

Normal button: <input id = "" name = "" class = "" type = "button"> </input>
Single button: <input id = "" name = "" class = "" type = "radio"> </input>
Select multiple buttons: <input id = "" name = "" class = "" type = "checkbox"> </input>

To display the Upload File Name:

<Input id = "" name = "" class = "" type = "text" onchange = "document. getElementById (''). value = this. value "> </input>

File Upload: <input id = "" name = "" class = "" type = "file"> </input>
Hidden field: <input id = "" name = "" class = "" type = "hidden"> </input>
Submit button: <input id = "" name = "" class = "" type = "submit"> </input>
Image submission button: <input id = "" name = "" class = "" type = "image"> </input>
Reset button: <input id = "" name = "" class = "" type = "reset"> </input>

Multi-line text field: <textarea cols = "" rows = "" id = "" name = ""> </textarea>

Drop-down menu:

<Select name = "" size = "" multiple>

<Option value = "" selected> </option>
<Option value = ""> </option>

</Select>

(3) hyperlink

Click to jump to JS: <a class = "" href = "#" id = "" onclick = "location. href ='' "> </a>
Empty hyperlink (click to jump to the top): <a href = "#"> </a>
Empty hyperlink (do not click): <a href = "javascript: void (0);"> </a>

Image hyperlink: <a href = ""> </a>

(4) images

Normal image:

Set the width and height of the image (scale down according to the proportion, the file size remains unchanged):

(5) Table

<Table border = "1" cellpadding = "10" cellspacing = "0">
<Tr>
<Th width = "100px"> A </th>
<Th width = "200px"> B </th>
</Tr>
<Tr>
<Td> A </td>
<Td> B </td>
</Tr>

</Table>

(6) List

Unordered list:

<Ul type = "disc">

<Li> first point </li>
<Li> second point </li>
</Ul>
<Ul type = "square">
<Li> first point </li>
<Li> second point </li>
</Ul>
<Ul type = "circle">
<Li> first point </li>
<Li> second point </li>

</Ul>

Ordered list:

<Ol type = "1">
<Li> first point </li>
<Li> second point </li>
</Ol>
<Ol type = "a">
<Li> first point </li>
<Li> second point </li>
</Ol>
<Ol type = "A">
<Li> first point </li>
<Li> second point </li>
</Ol>
<Ol type = "I">
<Li> first point </li>
<Li> second point </li>
</Ol>
<Ol type = "I">
<Li> first point </li>
<Li> second point </li>

</Ol>

(7) multimedia

Scroll Subtitle: <marquee> </marquee>

Background Music: <bgsound> </bgsound>

Audio, video, flash, and mpeg: <embed> </embed>

(8) Row Control

Title:

Section: <p> </p>

Line feed: <br>

Horizontal line:

5. Framework

<Frameset rows = "50% 50%">
<Farme src = "">
<Farme src = "">
</Frameset>

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.