What is the difference between css and html

青灯夜游
Release: 2021-11-09 11:31:30
Original
8181 people have browsed it

The functions of css: 1. Simplify the format code of the page and speed up the loading speed; 2. Avoid modification of page by page and shorten the time of modifying the page. The difference between css and html: 1. HTML is a web page structure, CSS is a web page style; 2. HTML consists of tags surrounding content, while CSS consists of a selector inherited from a declaration block.

What is the difference between css and html

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

What is CSS?

CSS is a computer language used to express document styles such as HTML (an application of Standard Generalized Markup Language) or XML (a subset of Standard Generalized Markup Language). The latest version of CSS is CSS3, which is a style design language that can truly separate web page performance and content.

Compared with the performance of traditional HTML, CSS can perform pixel-level precise control over the position and layout of objects in web pages, supports almost all font size styles, and has the ability to edit web page objects and model styles. , and can carry out preliminary interaction design. It is currently the best performance design language based on text display.

CSS can simplify or optimize the writing method according to the understanding ability of different users. It has strong readability for all types of people.

Simply put: CSS is used to change the appearance of html tags in the browser.

What are the functions of CSS?

CSS is flexible and changeable. In addition to general colors, fonts, backgrounds, etc., the style types that can be specified can also control character spacing, padding, size, etc., showing powerful definition capabilities. .

What users want to see is the content of the website. In order for users to see this information better, format control is needed to help. In the past, the distribution of the two on the page was staggered and combined, which was very inconvenient to view and modify. Now, separating the two will make it convenient for website designers. The content structure and format control are separated. It can only be composed of content, and the format control of all pages is directed to a certain CSS style file. The benefits of doing this are as follows.

1. The format code of the page is simplified. The external style sheet will also be saved in the cache by the browser, which speeds up the loading speed and reduces the amount of code that needs to be uploaded.

2. As long as you modify the CSS style sheet file that saves the website format, you can change the style and features of the entire website. This plays an important role for large websites and multi-page websites. This avoids page-by-page modifications and shortens the time for page modifications.

What is the difference between CSS and html?

1. Different properties

HTML is the basic markup language that describes the content and structure of web pages. However, CSS is an extension of HTML that modifies the design and display of web pages.

HTML is the structure of a web page, and CSS is the style of a web page. For example, if the entire web page is compared to a person, then HTML is the bones and CSS is the clothes.

2. Different syntax

HTML consists of tags surrounding content. CSS, on the other hand, consists of a selector declared in a block inheritance.

html syntax example is as follows:

<div>内容</div>
Copy after login

css syntax example:

div{font-size:12px;}
Copy after login

3. HTML files can contain CSS code, but CSS style sheets must not contain HTML code.

That is, CSS can be used in HTML files, but HTML cannot be used in CSS style sheets.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of What is the difference between css and html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template