Knowledge of HTML and CSS [1]

Source: Internet
Author: User

1. CSS annotation format /**/.

2. Pseudo-classes

(1) The pseudo class must be written at the end of the element selector.

(2) pseudo-Class A Sequence

 
A: Link
A: visited
A: hover
A: active

That is, love hate)

3. Several Basic HTML tags

For more information, see here.

DTD: Specify the XHTML 1.0 DTD in which the tag is allowed. S = strict, t = transitional, F = frameset.

<! Doctype> define the document type. STF

<HTML> define an HTML document. STF

<Body> define the subject of the document. STF

<H1> to <H6> defines the HTML title. STF

<P> define a paragraph. STF

<Br> define simple lines. STF

<HR> define a horizontal line. STF

<! --... --> Define comments. STF

<B> define bold text. STF

<I> define italic text. STF

<Em> the definition emphasizes the text. STF

<Big> define large text. STF

<Strong> the definition of text is more intense. STF

<Small> defines the small text. STF

<Sup> defines the upper-level text. STF

<Sub> define subscript text. STF

<BDO> defines the direction of the text. STF

<U> I do not agree to use it. Defines the underline text. TF

<PRE> define pre-formatted text STF

<Code> define a computerCodeText. STF

<Acronym> defines the abbreviation of the first letter. STF

<Abbr> define the abbreviation. STF

<Address> define the contact information of the Document Author or owner. STF

<BLOCKQUOTE> define block references. STF

<Q> define short references. STF

<Cite> Define reference (citation ). STF

<Ins> defines the inserted text. STF

<Del> defines the deleted text. STF

4. selection rules: Computing Features

Based on their feature levels, a style sheet can also go beyond the conflicting style sheet. A high-characteristic style always prevails over a style with a low feature. This is just a statistical game that calculates the specified number of selector.

    1. In the statistics SelectorIDNumber of attributes.
    2. In the statistics SelectorClassNumber of attributes.
    3. The HTML Tag Name format in the statistics selector.

Finally, write three numbers in the correct order. Do not add spaces or commas to get a three-digit number. (Note: You need to convert the number into a larger number ending with three digits .) The final number list corresponding to the selector can easily determine that a higher number is superior to a lower number. The following is a list of feature-specific delimiters:

 
# Id1 {XXX}/* A = 1 B = 0 C = 0 -->Feature = 100 */
Ul ul Li. Red {XXX}/* A = 0 B = 1 c = 3 -->Feature = 013 */
Li. Red {XXX}/* A = 0 B = 1 c = 1 -->Feature = 011 */
Li {XXX}/* A = 0 B = 0 C = 1 -->Feature = 001 */

5. Save the file encoding format

It is best to unify the encoding formats of HTML, CSS, and JavaScript files. You must specify a proper format if it is not uniform.

Encoding specified by HTML:

<Head>
<MetaHTTP-equiv = "Content-Type"Content= "Text/Html;Charset = gb2312 "/>
<Title>Demo</Title>
<LinkHref = "/demo. CSS"Rel =" stylesheet "type =" text/CSS">

Call the JS file:

<Script SRC= "/XX. js" Type= "Text/JavaScript" Encoding= "UTF-8"> </Script> 

Declare the encoding in the CSS file:

 
@ Charset "UTF-8 ";
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.