HTML review and html Review

Source: Internet
Author: User

HTML review and html Review
<Html> tag: defines HTML documents.

<Body> label: defines the document subject.

<H1>-

<Hr> label: Create a horizontal line

<! -- This is a comment --> comment

<Br/> label: line feed

HTML link

<A> tag: Link

By default, links appear in the browser as follows:

  • An unaccessed link is displayed in blue with an underline.
  • The accessed link is purple and underlined.
  • When you click a link, the link is displayed in red and underlined.

(1) href attribute: used to describe the link address

<A href = "url"> link text </a>

(2) target attribute: defines where the linked document is displayed

For example, target = "_ blank": the link will be opened in a new window.

(3) id attribute: bookmarks in an HTML document

For example, insert ID <a id = "tips"> text </a>

Create a link to the ID section in this document <a href = "# tips"> text </a>

Create a link to the other Document ID section <a href = "http://www.baidu.com/html-links.html#tips"> text </a>

Note:Always Add the forward slash to the subfolders.

Example: href = "http://www.baidu.com/html/

HTML The element labels in the header area are: <title>, <style>, <meta>, <link>, <script>, <noscript>, and <base>

<Title> tag: defines the titles of different documents.

  • Defines the title of the browser toolbar
  • The title displayed in favorites when a webpage is added to favorites
  • Title displayed on the search engine result page

<Base> tag: describes the basic link address/link target. This tag serves as the default link for all link tags in the HTML document:

<base href="http://www.baidu.com/images/" target="_blank">

<Link> label: link to the style sheet (CSS)

<link rel="stylesheet" type="text/css" href="mystyle.css">

<Style> element: Add CSS styles to render HTML documents.

<Meta> tag: the metadata provided is not displayed on the page, but is parsed by the browser.

Define keywords for search engines:

<meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript">

Define the description for the webpage:

<Meta name = "description" content = "free Web & Programming Tutorial">

Author of the web page definition:

<meta name="author" content="Runoob">

Refresh the current page every 30 seconds:

<meta http-equiv="refresh" content="30">

<Script> tag: used to load script files, such as JavaScript

HTML image-Image Tag () and source attribute (Src)

it is an empty tag that only contains attributes and does not contain closed tags.


(1) src attribute: "source" the source attribute value is the image URL.

(2) alt attribute: defines a string of prepared and replaceable texts for the image.

(3) height and width attributes: used to set the height and width of an image.

HTML table

<Table> label: table

<Tr> label: Line

<Th> label: Header

<Td> label: Cell

Colspan = "2": two segment cells of the link row

<table border="1">    <tr>        <th>Header 1</th>        <th>Header 2</th>    </tr>    <tr>        <td>row 1, cell 1</td>        <td>row 1, cell 2</td>    </tr>    <tr>        <td>row 2, cell 1</td>        <td>row 2, cell 2</td>    </tr></table>
HTML list

<Ul> tag: unordered list

<Ol> label: ordered list

<Li> label: Start of each list item

<ul><li>Coffee</li><li>Milk</li></ul><ol><li>Coffee</li><li>Milk</li></ol>
<Dl> label: Custom example table
<Dl> <dt> Custom list items </dt> <dd> Custom list items <dd> <dt> Custom list items </dt> <dd> definition of custom list items <dd> </dl>
HTML Block

<Div> element: block-level element, which can be used to combine containers of other HTML elements.

<Span> element: inline element, which can be used as a text container.

<Table> element: displays tabular data.

Block-level elements (block-level): when displayed in a browser, it usually starts (and ends) with a new line ). Example:

Inline: it usually does not start with a new line when it is displayed. Example: <B>, <td>, <a>,

HTML layout

<Div> block-level element or <table> table-based data

 

HTML form and Input

<Form> label: form

<Input> label: input

Text field: the default width is 20 characters.

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

Password Field: <input type = "password"> -- the password is not displayed and is replaced by a star or dot.

<form>Password: <input type="password" name="pwd"></form>

Single button: <input type = "radio">

<form><input type="radio" name="sex" value="male">Male<br><input type="radio" name="sex" value="female">Female</form>

Check box: <input type = "checkbox">

<form><input type="checkbox" name="vehicle" value="Bike">I have a bike<br><input type="checkbox" name="vehicle" value="Car">I have a car </form>

Submit button: <input type = "submit">

<form name="input" action="html_form_action.php" method="get">Username: <input type="text" name="user"><input type="submit" value="Submit"></form>
HTML framework

<Iframe> frame: more than one page is displayed in the same browser window.

Iframe Syntax:<Iframe src ="URL"> </Iframe>

Height and width attributes: defines the height and width of an iframe label. -- Attributes are measured in pixels by default,

<iframe src="demo_iframe.htm" width="200" height="200"></iframe>

Frameborder attribute: whether to display the border. The property value is "0". Remove the border of iframe.

<iframe src="demo_iframe.htm" frameborder="0"></iframe>

For example, click the link. The link address page is displayed in the iframe framework.

<iframe src="demo_iframe.htm" name="iframe_a"></iframe><p><a href="http://www.baidu.com" target="iframe_a">baidu.com</a></p>

Note: The name and target are the same.

 

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.