Web standards learning to understand the separation of structure and presentation

Web standards learning to understand the separation of structure and presentation
When discussing Web standards, one thing that always comes up is the importance of separating structure from presentation.

Understanding the difference between structure and presentation can be difficult at first, especially if you are not used to thinking about the semantic structure of documents.

However, it is important to understand this because, when structure and presentation are separated, it is easy to control presentation using a CSS document.

The structure consists of the main body of the document, plus semantic and structural tags.

Presentation is the style you give to your content. In most cases, presentation is how a document looks, but it can also affect how a document "sounds" - after all, not everyone uses a graphical browser.

Separate structure and presentation as much as possible.

In theory, you should use one HTML document to store content and structure, and one CSS document to control the presentation of the entire document.

It is still common today to have websites where presentation and structure are not separated.

So when we first start learning, we should develop a good habit of putting them in separate files. XHTML files can link and share external CSS and JavaScript documents.

<<:  Use CSS to achieve circular wave effect

>>:  Docker images export and import operations

Recommend

Detailed explanation of Tomcat directory structure

Table of contents Directory Structure bin directo...

Detailed explanation of transaction isolation levels in MySql study notes

background When we talk about transactions, every...

Comparison of the efficiency of different methods of deleting files in Linux

Test the efficiency of deleting a large number of...

JavaScript to achieve calendar effect

This article shares the specific code for JavaScr...

Three ways to delete a table in MySQL (summary)

drop table Drop directly deletes table informatio...

MySQL optimization query_cache_limit parameter description

query_cache_limit query_cache_limit specifies the...

MySQL uses the truncate command to quickly clear all tables in a database

1. Execute the select statement first to generate...

vue+springboot realizes login verification code

This article example shares the specific code of ...

CSS realizes div completely centered without setting height

Require The div under the body is vertically cent...

Share some uncommon but useful JS techniques

Preface Programming languages ​​usually contain v...

Build nginx virtual host based on domain name, port and IP

There are three types of virtual hosts supported ...

JavaScript to achieve simple provincial and municipal linkage

This article shares the specific code for JavaScr...