Basic Html learning (W3school-based network tutorial) and w3school network tutorial

Source: Internet
Author: User

Basic Html learning (W3school-based network tutorial) and w3school network tutorial

// Prevent garbled characters

Add in head

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

 

// Format the external style sheet in the head.

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

 

// Use the html style sheet for formatting

<Style type = "text/css">

Xxxx

</Style>

 

// Bgcolor defines the background color. background = "xxxx" specifies the background image. The image is displayed when the image size is smaller than the page size.

 

// <P> label </p>

Section label. The browser will ignore the layout in the source code, and omit unnecessary spaces and line breaks.

To wrap a line, use <br/>.

 

// H1-h6 title label

<H1> h1 title tag

<H2> h2 title tag

<H3> h3 title tag

<H4> h4 title tag

<H5> h5 title tag

<H6> h6 title label

Note: use only the title label in the title text. Do not use them only to generate bold text. Other labels or CSS can be used in bold.

 

// Text Center

<H4 align = "center"> Use align = "center" to center the text. </H4>

 

// The hr tag is used to add a horizontal line.

<Hr/>

 

// Comment <! -- XXXX -->

<! -- Annotations are not displayed in the browser. -->

 

// Background color

Bgcolor = "xxxx"

 

// Background image

Background = "xxxx"

 

// Link

Use the tag href = "xxxx" to define the target = "_ blank"

<A href = "http://www.baidu.com" target = "_ blank"> Baidu </a>

 

// Image

If the image cannot be displayed, the text in alt is displayed.

 

// Text Formatting

<B> Format the text. This is bold text and uses the B label. </B>

<Strong> text formatting, which increases the tone strong and uses the strong label </strong>

<Big> Text Formatting. This is a large word, big label. </big>

<Em> text formatting, which focuses on Text emphasized and uses the em tag </em>

<I> text format: italic, Which is italic in italic. Use an I tag. </I>

<Small> text format: small, which is a small word. Use the small label. </small>

 

// Pre label used for pre-formatted text

<Pre>

This is

Pre-formatted text.

It retains Spaces

And line feed.

</Pre>

 

// Link to a location on the same page and name the "anchor" with the name attribute"

<A href = "# C4"> View Chapter 4. </A>

<H2> Chapter 1

<P> This chapter explains ba bla </p>

<H2> Chapter 2

<P> This chapter explains ba bla </p>

<H2> Chapter 3

<P> This chapter explains ba bla </p>

<H2> <a name = "C4"> Chapter 4 </a>

<P> This chapter explains ba bla </p>

<H2> Chapter 5

<P> This chapter explains ba bla </p>

 

// Table is used for the table. The border is the border width, and the tr-th-td

<Table border = "1">

<Tr>

<Th> header 1 </th>

<Th> header 2 </th>

<Th> header 3 </th>

</Tr>

<Tr>

<Td> 100 </td>

<Td> 200 </td>

<Td> 300 </td>

</Tr>

<Tr>

<Td> 400 </td>

<Td> 500 </td>

<Td> 600 </td>

</Tr>

</Table>

 

Result:

// Cells that span two columns:

<Table border = "1">

<Tr>

<Th> name </th>

<Th colspan = "2"> phone number </th>

</Tr>

<Tr>

<Td> Bill Gates </td>

<Td> 55577854 </td>

<Td> 55577855 </td>

</Tr>

</Table>

Result:

// Cells that span two rows:

<Table border = "1">

<Tr>

<Th> name </th>

<Td> Bill Gates </td>

</Tr>

<Tr>

<Th rowspan = "2"> phone number </th>

<Td> 55577854 </td>

</Tr>

<Tr>

<Td> 55577855 </td>

</Tr>

</Table>

Result:

// Cellpadding with cell margins:

<Table border = "1" cellpadding = "10">

<Tr>

<Td> First </td>

<Td> Row </td>

</Tr>

<Tr>

<Td> Second </td>

<Td> Row </td>

</Tr>

</Table>

Result:

// Position of elements in the table

<Table width = "400" border = "1">

<Tr>

<Th align = "center"> consumption item </th>

<Th align = "center"> August 1, January </th>

<Th align = "center"> August 1, February </th>

</Tr>

<Tr>

<Td align = "left"> Clothes </td>

<Td align = "right" >$ 241.10 </td>

<Td align = "right" >$ 50.20 </td>

</Tr>

<Tr>

<Td align = "left"> cosmetics </td>

<Td align = "right" >$ 30.00 </td>

<Td align = "right" >$ 44.45 </td>

</Tr>

</Table>

// An unordered list:

<Ul>

<Li> coffee </li>

<Li> tea </li>

<Li> milk </li>

</Ul>

// An ordered list with start as the sequence number:

<Ol start = "50">

<Li> coffee </li>

<Li> milk </li>

<Li> tea </li>

</Ol>

 

// Disc project symbol list:

<Ul type = "disc">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ul>

// List of Circle project symbols:

<Ul type = "circle">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ul>

// List of Square project symbols:

<Ul type = "square">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ul>

// Number list:

<Ol>

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ol>

// Letter list:

<Ol type = "A">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ol>

// Lowercase letter list:

<Ol type = "a">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ol>

// Rome letter list:

<Ol type = "I">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ol>

// Lowercase Rome letter list:

<Ol type = "I">

<Li> Apple </li>

<Li> bananas </li>

<Li> lemon </li>

<Li> orange </li>

</Ol>

// A nested list:

<Ul>

<Li> coffee </li>

<Li> tea

<Ul>

<Li> black tea </li>

<Li> green tea </li>

</Ul>

</Li>

<Li> milk </li>

</Ul>

// Form: form-input

Text Field text fields

Password in the password field. * is displayed when the password is entered.

The check box checkbox is a small box. checked specifies whether the option is selected by default. You can click to select or cancel the option.

Radio button: radio, checked specifies the default option. When you click a button, the button becomes selected, and all other buttons become unselected.

Drop-down list: select-option. You can use selected to specify the selected options by default.

Text Field textarea, rows height, cols width

Button

Submits submission

Effect of borders around fieldset

 

<Form action = "xxxx"> <! -- If the action attribute is omitted, the action is set to the current page. Method specifies the HTTP method GET or POST used when submitting a form -->

<! -- The GET method is used by default. If form submission is passive and there is no sensitive information, such as search engine queries. When GET is used, the form data is visible in the page address bar.

If the form is updating data or contains sensitive information (such as a password ). POST is safe because the submitted data in the page address bar is invisible. -->

Last name: <input type = "text" name = "firstname"/> <br/>

Name: <input type = "text" name = "lastname"/> <br/>

Password: <input type = "password" name = "password"/> <br/>

Hobbies: basketball <input type = "checkbox" name = "aihao" value = "basketball"/> football <input type = "checkbox" name = "aihao" value = "football"/> <br/>

Gender: male <input type = "radio" checked = "checked" name = "Sex" value = "male"/> female <input type = "radio" name = "Sex" value = "female"/> <br/>

Select the Place of birth:

<Select name = "place">

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

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

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

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

</Select>

Introduction:

<Textarea name = "jianjie" rows = "2" cols = "25">

This person is very lazy and has nothing left!

</Textarea>

<Input type = "button" value = "Hello world! ">

<Input type = "submit" value = "submit"> <! -- Click Submit to submit the data to the action page. If the action attribute is omitted, the action is set to the current page. -->

<Fieldset>

<Legend> Health Information </legend>

Height: <input type = "text"/>

Weight: <input type = "text"/>

</Fieldset>

</Form>

 

// Arrange the image: Set the alignment of the image

<P> image in text, text data is the default mode </p>

<P> image text center </p>

<P> image in text </p>

 

<P>

A section with an image. Set the align attribute of the image to "left ". The image is moved to the leftmost part of the text.

</P>

 

<P>

A section with an image. Set the align attribute of the image to "right ". The image will float to the rightmost of the text.

</P>

 

Related Article

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.