Getting Started with HTML

Source: Internet
Author: User
Tags tag name

Html&scc

According to the definition of the universal, HTML full name Hypertext Markup Langue, Chinese name: Super-Text Markup language
HTML is used to define document content and structure, and HTML-written code generates web pages from browser rendering
CSS full name cascoding style Sheets, Chinese name: Cascading style sheets for controlling the style of HTML documents.
HTML and CSS Overview:
HTML determines the content and structure of the document; CSS determines the style of the document, the basis of the page performance, the control layout, the control element rendering.

HTML annotations

Writing format:
Mainly used to describe the function of the code, the browser to parse the HTML code will ignore the comments, the benefits of a lot of comments, such as: it is convenient for other colleagues in the project team to understand your code, but also convenient for yourself or others to understand and modify your code later.

HTML elements

An element is also called a tag, an annotation, or a tag, an HTML document has a large number of elements, and all the structures in the HTML are organized into pages by elements. Its components include start tag, element content, end tag
For example:

<h3> two large front teeth </h3>

The H3 element here represents a level 3 heading, and you need to be aware that the end tag is preceded by an English slash sign

<a href="/classroom/" > Join </a> now

The section after the start tag is called a property, can only be written in the start tag, the function is to append some functions, here the HREF called the property name, "/classroom/" is the attribute value, the tag can have more than one property.
Empty element (also called free-closing Element): refers to the absence of element content and end tags (such as an IMG element)
Empty element writing format:< tag Name property > or < Tag name/property >.

Hierarchy of elements

An element content can contain other elements that form a nested hierarchy, but the two elements cannot be nested with each other.
If the A element directly contains the B element:
A is the parent of B, and B is a child element.
If two elements together have a parent element:
They are fraternal elements.
If a directly or indirectly contains a B element:
A is the ancestor of B, and B is the descendant element of a.

HTML Document Structure

1. Document declaration, it must be placed in the first line of the HTML document (it is not an element nor a comment)
Write code <!..... > (input!) Press the TAB key to automatically load), to inform the browser, the current document is using which HTML version, if you do not write the document declaration, the browser renders the page will enter the strange mode, because the browser does not know what version you use, will default to use the minimum version of the resolution, resulting in not knowing many tags, only know the element content.

Html

The topmost element, also known as the root element (root tag or root tag), is the ancestor of all elements, and all other elements in the document must be placed in its element content.
Related properties: lang
It is a language declaration attribute used to define the display language of the current document, such as lang= "ZH-CN", which indicates that the definition language is Chinese.

Head element

Also called the document header, which is a child of the HTML element; The document header can contain additional elements that describe additional information about the page (note: The contents of the head element are not displayed on the page).
The head element typically contains the following elements:
Identifies the document title, which is displayed in the browser's title bar or tab page.
This is an empty element, which is an additional information about the page that identifies the other elements of the page.
For example:

<meta charset="UTF-8" >

Instructs the browser to use the character encoding set UTF-8 parsing the page, without which the page is usually garbled, and note that the character encoding set should be used as the first child element of the head

BODY element

Also called the document body, all the visible content in the page is placed within the element, and the BODY element can contain a large number of other elements that define the document content and structure.

Path Absolute Path

When a Web site is deployed to a server, all resources in the site can be accessed through an address (path) that is written in: protocol://Domain/directory
For example: (http://www.google.com/)
Protocol: HTTP
Domain Name: www.google.com
Directory: root directory
Usage scenarios for absolute paths:
Only absolute paths can be used when accessing out-of-site resources;
Access to the site resources, if the website has been deployed to the service department, you can use the absolute path, and can use the protocol and domain name

Relative path

is relative to the current resource location, can only be used to access the resources in the station, the writing format is:./path (here./Can be omitted, but preferably not omitted, not very good for me to understand)
.. /indicates return to the previous level directory.

Getting Started with HTML

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.