Initial knowledge of HTML and CSS

Source: Internet
Author: User
Tags html comment tag name

---restore content starts---

PS Applications
Volume size w.h
-How to: window, info, top right panel options, ruler units, pixels
Transduction
-How to: Slice tool, file, save as Web all formats, JPEG, store, slice: Selected slices, save
HTML
Full name: Hypertext Markup Langguage. Hypertext Markup Language.
Function: The code renders the page through the browser rendering. HTML is used to define the content structure of a document
Hypertext hypertext: Includes not only text, but also images, audio, video and other non-text elements.
markup language Markup Language: is a set of tag tags, HTML uses tag tags to describe web pages.
A Web page is a document and the core of a document, that is, content, different meanings of content constitute the structure of the document.
CSS


casading style Sheet: Cascading style sheets, Code written in the language is usually parsed by the browser
html the appearance style in the document page is determined by the CSS
-Html+css is rendered in a browser to create the desired Web page. < Span class= "token p" >
html comment
Note writing format:<!--comments-->
-HTML annotations are primarily used to describe code functions
-browser parsing HTML code ignores comments

HTML Elements
1. HTML elements are an important part of an HTML document, and an HTML document consists of a large number of elements that make up all the content structures in the HTML, all of which are organized into pages by elements.
2. HTML elements consist of a start tag attribute element content end tag
3. Writing format:< start tag properties > element content < end tag >;
4. Attributes represent additional information about an element; property consists of a property name and a property value, written in: Property name = "Property value"
5. Empty elements: Also called self-closing and elements, without element content and end tags

How empty elements are written:

< tag Name properties >

< tag name attribute/>

-Hierarchical structure of elements
Meaning: The content of an element can contain other elements, forming a nested hierarchy;
-if the A element directly contains B then a is the parent of B, and B is a child element
-If two elements have the same parent element, they are sibling to each other
-If a directly or indirectly contains B then a is the ancestor of B, and B is the descendant element of a
-Two elements can not be nested between each other (position can not be messy)
HTML Document Structure
Document declaration: Not an element, not a comment, it must appear in the first line of the HTML code
The written format is: <! DOCTYPE html>
Used to inform the browser which HTML version the current document is using (using the HTML5 version)
If you do not write the document declaration, the browser renders the page will enter the strange mode, solve the strange mode: join: <! DOCTYPE html>
The 1.html element is also called a tag, the root element, which is the ancestor element of all other elements
2. Related properties: lang
-this property specifies in what natural language the text in the document is written
-this property may affect the browser's language reading and translation behavior
The 3.head element is also called the document header, which is the first element of the HTML element the document header can contain some other elements that describe additional information about the page
-The contents of the head element are not displayed on the page
Head elements typically include < title> and < meta>
-< title> identifies the document title, which is displayed in the title bar of the browser or on the tab page, and can have multiple
-< meta> Other metadata that identifies the page (additional information about the page), which is an empty element
Sample:< meta charset= "UTF-8" >
-instructs the browser to parse the page using the character encoding set UTF-8
For better geographical compatibility, avoid code, set the character encoding set to UTF-8 and use that code as the first child element of the head
body element (document body)

absolute path and relative path
absolute path:
Writing format: protocol://Domain name/directory

  1. When you access an off-site scene, you can only use the absolute path
  2. When accessing an out-of-site resource, the absolute path is available if the website is deployed to the server. And can omit the agreement and domain name

relative path:

< Span class= "token p" >< Span class= "token lf" > writing format:./path indicates the directory where the current resource resides and must be the start of a relative path. Can omit
writing format:.. /path   Indicates return to the previous level of the directory

First knowledge of HTML and CSS

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.