HTML Basic Learning Notes

Source: Internet
Author: User
Tags unique id

HTML refers to Hypertext Markup Language (Hyper Text Markup Language), a markup language used to describe a language of a Web page.

First, the basic structure of HTML

1. HTML tag (HTML tag), keywords surrounded by angle brackets (such as appear in pairs , such as <b> ( start tag ) and </b> ( end tag ).

2, the HTML title (Heading) is defined by the

3, the HTML paragraph is defined by the label <p>.

4. HTML links are defined by tags <a>. Such as:

<a href= "http://www.runoob.com" > This is a link </a>

tip: Specify the address of the link in the href attribute.

5, the HTML image is defined by the label . Such as:

Note: The name and dimensions of the image are provided in the form of an attribute.

6. Tip: Use lowercase tags.

Second, the basic content

1. HTML empty elements: HTML elements with no content are called empty elements. The empty element is closed in the Start tab. <br/> is the empty element without closing the label (the <br/> tag defines a newline).

2. HTML attributes:

    • HTML elements can set properties
    • property to add additional information to the element
    • Properties are generally described in the start tag
    • A property is always in the form of a name/value pair, such as: name= "value".
    • Property values should always be included in quotation marks. Double quotes are the most common, and single quotes are typically used in the property value itself to contain double quotes, for example: Name= ' John ' shotgun ' Nelson '.
    • Use lowercase attributes

① commonly used Tag properties:

    • <body>:bgcolor background Color
    • <a>:target specify where to open the link (new window, original window, etc.)

② Common Properties:

    • Class: The name of the specified element
    • ID: The unique ID of the specified element
    • Style: Specify element style
    • Title: Additional information for the specified element

3. HTML title:

The ① title (Heading) defines the maximum caption by,

②html horizontal:

③html Annotation Format Example:<!-- This is a comment -->; the browser ignores comments and does not display them.

4. HTML Paragraph

The ① paragraph is defined by the <p> tag. Such as:

<p> This is a paragraph </p>

Note: The browser automatically adds blank lines to and from the paragraph. (</p> is a block-level element)

②html polyline

Line wrap (new line) without creating a new paragraph, using the <br/> tag.

<p> This <br> paragraph <br> demonstrates the effect of a branch </p>

③, HTML output-use reminders: When the page is displayed, the browser removes extra spaces and blank lines from the source code. All contiguous spaces or blank lines are counted as a single space. Note that all consecutive empty lines (line breaks) in the HTML code are also displayed as a single space.

5. The html
  • <title> tags define the titles of different documents.
  • <title> is required in the html/xhtml documentation.
  • <title> elements:
    • Defines the title of the browser toolbar
    • Titles that appear in favorites when a page is added to a favorite folder
    • Title displayed on the Search engine results page
③html <base> Elements <base> tags describe the basic link address/link target, which is the default link for all the link labels in an HTML document. ④html <link> Elements <link> tags define the relationship between a document and an external resource. <link> tags are typically used to link to style sheets:
  • The <style> tag defines the style file reference address for the HTML document.
  • In the <style> element you can also add a style directly to render the HTML document:
⑥html <meta> Elements
    • The META tag describes some basic meta-data.
    • The <meta> tag provides metadata. The metadata is also not displayed on the page, but is parsed by the browser.
    • Meta elements are typically used to specify the description of a Web page, keywords, last modified time of the file, author, and other meta-data.
    • Meta data can be used for browsers (how to display content or reload pages), search engines (keywords), or other Web services.
    • <meta> generally placed in
    • Define keywords for search engines:
    • <meta name= "keywords" content= "HTML, CSS, XML, XHTML, JavaScript" >
    • Define the description for the page:
    • <meta name= "description" content= "Free Web & Programming Tutorials" >
    • Define page Authors:
    • <meta name= "Author" content= "Runoob" >
    • Refreshes the current page every 30 seconds:
    • <meta http-equiv= "Refresh" content= ">"
⑦html <script> Elements <script> tags are used to load script files, such as: JavaScript.

6. HTML text formatting

label Description
<b>
Define bold text
<em> Define text-focused
<i> Defining italic characters
<small>
Define Small words
<strong>
Define the aggravating tone
<sub> Define the subscript Word
<sup>
defining superscript words
<ins>
Defining Insert Words
<del>
Define Delete words

7. HTML style

① Tags:

    • <style>: Style definition
    • <link>: Resource References

② Properties:

    • Rel= "stylesheet": External style sheet
    • Type= "TEXT/CSS": Introducing document types
    • Margin-left: Margin

③ three ways to insert style sheets:

    • External style sheet: <link rel= "stylesheet" type= "Text/css" href= "Mystyle.css" >
    • Internal style sheet:

<style type= "Text/css" >

Body {"style=" margin-left:60px; >p{margin-left:20px}

</style>

    • Inline style sheet: <p style= "color:red" >

8. HTML link

① Link Data:

    • Text link
    • Image link

② Properties:

    • HREF attribute: Link to another document
    • Name property: Create a link within a document

③img Tag Properties:

    • ALT: Replace Text property
    • Width: Wide
    • Hight: High
    • Example:
1 <! DOCTYPE html> 2 

9. HTML table

label Description
<table> Defining tables
<th> Table header for defining tables
<tr> Define rows for a table
<td> Defining table Cells
<caption> Defining table Headings
<colgroup> Define Groups for table columns
<col> Define properties for a table column
<thead> Define a header for a table
<tbody> Defining the body of a table
<tfoot> Define a footer for a table

10. HTML List

label Description
<ol> Defining an ordered list
<ul> Defining unordered Lists
<li> Defining list Items
<dl> Definition List
<dt> customizing list items
<dd> Define a description of a custom list item

① unordered List

Using tags:<ul>, <li>

Properties: Disc, Circle, Square

② ordered list

Using tags:<ol>, <li>

Properties: A, a, I, I, start

③ nested lists

Using tags:<ul>, <ol>, <li>

④ a custom list

Using tags:<dl>, <dt>, <dd>

11. HTML Block

①html block Element

When a block element is displayed, it usually starts with a new line

such as:

②html inline elements

Inline elements typically do not start with a new line

such as:<b>, <a>,

③html<div> elements

The <div> element is also known as a block element, which is primarily a container for combining HTML elements

④html<span>

The <span> element is an inline element and can be used as a container for text

⑤ Example:

1 <! DOCTYPE html> 2 {9             color: Red;         }11     </style>12    

12. HTML Layout

①div layout

1 <! DOCTYPE html> 2 {8 margin: 0px; 9}10 #container{One width: 100%; height: 640px; Background-color: Darkgray; 14}15 #heading{width: 100%; height: 10%; Background-color: Aqua; 19}20 #conten_menu  {width : 30% ; height : 80% ; Background-color : Aquamarine , float : left ; }26 #conten_body  {width : 70% ; height  : 80% ; Background-color : Blueviolet ; + float : Left ; }32 #footing  {33 Width : 100% ; height : 10% ; Background-color : Black ; + Clear : both ; PNS }38 </style>39      

Display effect:

②table layout

1 <! DOCTYPE html> 2 left menu <ul>15 <li>ios</li>16 <li>android</li>  <li>html5</li>18 </ul>19 </td>20 <td width= "60%" height= "80%" style= "" ></td>21 <td width= "20%" height= "80%" style= "" ></td>22 </tr>2 3 <tr>24 <td colspan= "3" width= "100%" height= "10%" style= "" style= "Color:rgb (0, 0, 255);" >> This is the bottom </td>25 </tr>26 </table>27 </body>28 

Display effect:

13. HTML form

① forms for getting different types of user input

② commonly used form tags:

label Description
<form> Define a form for user input
<input> Defining input fields
<textarea> Define a text field (a multiline input control)
<label> Defines the label for the <input> element, typically the input title
<fieldset> Defines a set of related form elements and uses the outer box to contain them
<legend> Defines the title of the <fieldset> element
<select> A list of drop-down options is defined
<optgroup> Defining an option group
<option> Define options in the drop-down list
<button> Define a click button
<datalist>
Specify a predefined list of input control options
<keygen>
Defines the key pair generator field for the form
<output>
Define a calculation result

③ code Example:

1 <! DOCTYPE html> 2 User name: <input type= "Text" >11Password: <input type= "password" >13 <br/>14 like the fruit there?           <br/>16 Apple <input type= "checkbox" >17 fragrant pear <input type= "checkbox" >18 Banana <input type= "checkbox" >19 <br/>20 please opt-in: 21 male <input type= "Radio" name           = "Sex" >22 female <input type= "Radio" name= "Sex" >23 <br/>24 Please select your favorite website: 25 <select>26 <option>jikexueyuan.com</option>27 <option>www.google.co m</option>28 <option>www.iwen.org</option>29 </select>30 <INP UT type= "button" value= "buttons" >31 <input type= "Submit" value= "Submit" >32 </form>33 <texta Rea cols= "rows=" > Please fill in your personal information here </textarea>34 </body>35    

14. HTML Framework

① Frame Tags: frames are a great part of the design of a page.

② frame Label (<frameset>) (superseded):

Frames and tags define how to split a window into a frame

Each frameset defines a series of rows or columns

The ROWS/COLSDE value specifies the area of the screen that each row or column occupies

③ Common Tags:

      • Noresize: Fixed frame size
      • COLS: Column
      • Rows: Rows

④ Inline frame (more useful)

Iframe

15. HTML Background

① Background Tags: Background

② Background color: Bgcolor

③ Color:

The color is defined by a hexadecimal symbol, which is made up of red, green, and blue values (RGB)

Minimum value of color value: 0 (#00)

Color value Max: 255 (#FF)

Red: #FF0000

Green: #00FF00

Blue: #0000FF

16. HTML Entities

In HTML, some characters are reserved and must be replaced with character entities. The less than sign (<) and greater than sign (>) cannot be used in HTML because the browser mistakenly considers them to be labels.

If you want to display reserved characters correctly, we must use the character entity (character entities) in the HTML source code. The character entity looks like this:

&entity_name;entity_number;

To display the less than sign, we must write:&lt; or & #60; & #060;

HTML Basic Learning Notes

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.