HTML+CSS Basic Summary

Source: Internet
Author: User

1. First declare the correct document type DOCTYPE

There are typically four document types to choose from:

DOCTYPE is defined before HTML to tell the browser that the page contains HTML, XHTML, or both, so that the browser can parse the label correctly. According to research, most browsers will parse this statement in a common way, so most of them use the HTML4.01 standard.

2. When writing HTML, try not to use an embedded CSS style, because doing so will cause problems in your code, so it is best to write the CSS style after the content structure is finished when you start writing the code.

3. Introduce a CSS style sheet to the head tag

  In theory, you can introduce CSS stylesheets anywhere, but the HTML specification suggests introducing the page's head tag to speed up page rendering.

The way to introduce a CSS style sheet is:

<link rel= "stylesheet" type= "text/css" media= "screen" href= "Xx.css" >

  The above media= "screen" Explanation:

Refer to screen (default) and submit to computer screens;
Print, output to printer;
Projection, submitted to the projector;
Aural, loudspeaker;
Braille, submitted to the Braille tactile sensing device;
TTY, telex typewriter (using fixed fonts);
TV, TV;
All, output devices

4. Introduce JavaScript at the bottom of the page:

  When you're making a Web page, keep in mind that the principle is "to make the page appear to the user as quickly as possible," and when a script is loaded, the page stops loading until the script is loaded, so some people always like to put JavaScript scripts in front of the page. Doing so delays the loading of the page. If your JS file is just to implement certain functions (such as clicking on a button event), then you can safely introduce it at the bottom of the body, which is definitely the best way

5. Recommended browser plugin, help you to learn the number of HTML:

1. The development of the standard verification at any time, your non-rigorous code will make your page holes, the best way is to verify that the following is the authentication plug-in address:

Https://addons.mozilla.org/en-US/firefox/addon/60

  

For example, click Download anyway to download.

  Firebug Plugin:

2. Firebug is a well-deserved web development best plugin, it can not only debug JavaScript, but also intuitively let you know the properties and location of the page tag.

: https://addons.mozilla.org/cn-ZH/firefox/addon/1843

Note: It's important to learn to use Firebug , which will make you more effective.

How to use please visit: http://michaelsync.net/2007/09/08/firebug-tutorial-overview-of-firebug

3. YSlow Plugin:

It will analyze your < page and return a "transcript", which carefully analyzed all aspects of this page, the need to improve the place, although it is a bit harsh, but it will definitely help you, highly recommended

: http://developer.yahoo.com/yslow/

How to use:http://lusongsong.com/reed/362.html

6. When writing HTML code, use lowercase tags as much as possible, because it is useless to write uppercase tags, and it also increases the difficulty of reading.

7. Using the H1–h6 label

I suggest you use all six of them in the Web page, although most people will only use the first four, but the most use of H will have many benefits, such as device-friendly, search engine-friendly, may wish to replace your P tag h6.

8. Use the UL list layout to navigate the menu

Why use the UL layout to navigate the menu?—— because UL was born to define the list for

9. Learn to deal with IE

The following practices are only valid for IE

<!--[If Lt IE 7]>

CSS file links that you want to reference

<! [endif]-->

        

HTML+CSS Basic Summary

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.