HTML5 basic knowledge learning notes, html5 learning notes

Source: Internet
Author: User

HTML5 basic knowledge learning notes, html5 learning notes
1. Html5 Basics

1.1HTML5 basic labels:
Head: Header label, which is usually set in the head by referencing the basic configurations and files of some web pages;
Body: Content tag, which contains the content to be displayed on the entire webpage;
1.2HTML5 title:
H1... H6, etc. The larger the number, the smaller the font size of the corresponding title;
1.3HTML5 Section
The p tag indicates a paragraph. You can write a text paragraph in the p tag;
1.4HTML5 connection
The a tag indicates the connection. You can click it to jump to another url;
1.5HTML5 Image
The img label indicates the Image Tag, which can be used to set the image display;
1.6HTML5 line feed label
The br label indicates a line break, and "/" is last added when it is used, because this is more standard.

2. Introduction to HTML5 Elements

Element: All the code from the start tag to the end tag, the elements can be nested, and this attribute can be a Web page that can form a variety of combinations.

3. HTML attributes

You can set attributes to provide more attributes for elements. Attributes exist as key-value pairs.
Eg: href = "xxxxx"

Common tag attributes:
H1 title label: align: set align
Body label: bgcolor: sets the background color of the entire body.
A Tag: target: specify where to open the connection

Common attributes:
-Class: Specifies the Class Name of the element.
-Id: Unique id of the specified Element
-Style: Specifies the style of the element.
-Title: Additional information of the specified Element

4. HTML formatting

Common format tags:
-B label: Define bold characters
-Big tag: Define the font size
-Em tag: Define text-oriented
-I tag: Define italic text
-Small label: Defines the trumpet.
-Strong label: Aggravated tone Definition
-Sub tag: Define subscript
-Sup tag: Define the upper mark
-Ins tag: Define the insert word
-Del tag: Define the delete word

5. HTML Style

Three style sheet insertion methods:

-External style sheet:
<Link rel = "stylesheet" type = "text/css" href?”mystyle.css ">
-Internal style sheet:
<Style type = "text/css">
Body {background-color; red}
P {margin-left: 20px}
</Style>
-Inline style sheet:
<P sytle = "color: red">

6. HTML link

Href attribute: Link to another document, Jump outside the page
Name attribute: creates a link in the document and jumps to the page.
Eg:
<A name = "tips"> location to jump </a>
<A href = "# tips"> Start position </a>

7. HTML table

Tag
<Table>:Definition table
<Caption>:Define table title
<Th>:Define the table Header
<Tr>:Define table rows
<Td>:Define table units
<Thread>:Define the table Header
<Tbody>:Define the table subject
<Tfoot>:Define the table footer
<Col>:Define column attributes of a table
Tables
The simplest table:
<Table border = "1">
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
<Td> Table 3 </td>
</Tr>
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
<Td> Table 3 </td>
</Tr>
</Table>
Table with table header:
<Table border = "1">
<Tr>
<Th> Unit </th>
<Th> Unit </th>
<Th> Unit </th>
</Tr>
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
<Td> Table 3 </td>
</Tr>
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
<Td> Table 3 </td>
</Tr>
</Table>
Table with title:
<Table border = "1">
<Caption> important tables </caption>
<Tr>
<Th> Unit </th>
<Th> Unit </th>
<Th> Unit </th>
</Tr>
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
<Td> Table 3 </td>
</Tr>
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
<Td> Table 3 </td>
</Tr>
</Table>
Labels in the table:
<Table border = "1">
<Caption> important tables </caption>
<Tr>
<Th> Unit </th>
<Th> Unit </th>
</Tr>
<Tr>
<Td> Table 1 </td>
<Td> Table 2 </td>
</Tr>
<Tr>
<Td>
<Ul>
<Li> pineapple </li>
<Li> pineapple </li>
<Li> pineapple </li>
</Ul>
</Td>
<Td> I want to eat it </td>
</Tr>
</Table>
Cell spacing settings table:<Table border = "1" cellspacing = "10">
Cell margin settings table:<Table border = "1" cellpadding = "10">
Table background color, table background image settings:
Background Image: <table border = "1" background = "images/Desert.jpg">
Background Color: <table border = "1" bgcolor = "aqua">

8. Use of the HTML list

List tags:
-<Ol>:Ordered list
-<Ul>:Unordered list
-<Li>:LIST ITEMS
-<Dl>:List
-<Dt>:LIST ITEMS
-<Dd>:Description

Examples of common lists:
Unordered list:
<Ul type = "square">
<Li> 1st </li>
<Li> 2nd </li>
<Li> 3rd </li>
<Li> 4th </li>
</Ul>
Tags: <ul>, <li>
Attribute: disc, circle, square represents the symbol style before the list

Ordered list:
<Ol start = "10">
<Li> 1 </li>
<Li> 2 </li>
<Li> 3 </li>
<Li> 4 </li>
</Ol>
Tags: <ol>, <li>
Attribute: A, a, l, I, start indicates the number style before the ordered list

Nested list:
<Ul>
<Li> animals </li>
<Ul>
<Li> puppy </li>
<Li> kitten </li>
</Ul>
<Li> plants </li>
<Ul>
<Li> Xiaoxiao </li>
<Li> Xiaohua </li>
</Ul>
<Li> Human </li>
</Ul>
Tags: <ul>, <ol>, <li>

Custom list:
<Dl>
<Dt> ahah </dt>
<Dd> sssssssss </dd>
<Dt> ahah </dt>
<Dd> sssssssss </dd>
<Dt> ahah </dt>
<Dd> sssssssss </dd>
</Dl>
Tags: <dl >,< dt >,< dd>

9. Use of HTML Blocks

HTML block elements:When the block element is displayed, it usually starts with a new line.
Generally, HTML inline elements:Inline elements generally do not start with a new line
Generally, <B>, <a>, and
HTML <div> elements:A div element is also called a block element. It is mainly a container that combines HTML elements.
HTML <span> elements:Span is an inline element and can be used as a text container.

10. HTML5 Layout

In general, you can use div for layout or table for layout. Using these two labels, you can build a general frame of a web page and then add detailed elements to it;

11. HTML5 forms

Common form labels:
<Form>:Form
<Input>:Input box
<Textarea>:Text Box
<Label>:Control label
<Fieldset>:Definition domain
<Legend>:Domain Title
<Select>:Select list
<Optground>:Quota Group
<Option>:Options in the drop-down list
<Button>:Button
Common forms:
Check box form:
Eg: select the fruit you like:
Apple <input type = "checkbox">
Banana <input type = "checkbox">
Peach <input type = "checkbox">
Single button:
Eg: select your gender:
Male <input type = "radio" name = "sex">
Female <input type = "radio" name = "sex">
Drop-down box:
Eg: <select>
<Option> Shanghai </option>
<Option> Nanjing </option>
<Option> Beijing </option>
</Select>
Text Field:
Eg: <textarea cols = "30" rows = "10"> please input your message here... </Textarea>
Button:
Eg: <input type = "submit" value = "submit">
<Input type = "button" value = "Submit">
Submit data in a form to the server:
Eg: <form action = "http: // localhost/MyServer/server1.php" method = "get">
<Table>
<Tr>
<Th colspan = "2"> logon </th>
</Tr>
<Tr>
<Td> User name: </td>
<Td> <input type = "text" name = "name"> </td>
</Tr>
<Tr>
<Td> password: </td>
<Td> <input type = "password" name = "password"> </td>
</Tr>
<Tr>
<Td colspan = "2"> <input type = "submit" value = "submit"> </td>
</Tr>
</Table>
</Form>

12. HTML5 framework

Frame:Framework tag
The framework plays a major role in page design.

Frameset:Framework set label
Framework set labels define how to split windows into frames
Each frameset defines a series of rows or columns
The value of rows and cols specifies the area occupied by each line or column on the screen.

Common labels:Norsize: Fixed Frame Size, cols column, and rows row
Inline framework:Iframe, the recommended framework

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.