HTML principle: Put the content in HTML and do not rely on CSS

Source: Internet
Author: User

Content should be placed in HTML instead of CSS. This is an important principle of HTML. The following example clearly demonstrates this problem:

When CSS is available, the page content is normal.

When a page is unavailable and can only be accessed through https, CSS becomes invalid because the CSS of the page is http. At this time, the page content is lost, because the table on this page depends on the CSS image.

 

HTML compliant with W3C standards is like this: text is used for content, text-indent:-3000px is used to offset the text to invisible places, and background image is used for replacement, so that when CSS is unavailable, the text is displayed. HTML and CSS code compliant with W3C standards download: http://files.cnblogs.com/sink_cup/report.7z

When CSS is available, the text offset shows the background image. The effect is as follows:

When CSS is disabled, the text is displayed. The effect is as follows:

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.