Home > Web Front-end > CSS Tutorial > What is the difference between css and div

What is the difference between css and div

coldplay.xixi
Release: 2020-11-13 15:29:54
Original
5037 people have browsed it

The difference between css and div: 1. The div tag can define a partition or section in the document, which is used to define a separated block or a region in the HTML document; 2. CSS is a method used to express Computer languages ​​for file formats such as HTML or XML.

What is the difference between css and div

(Recommended tutorial: css video tutorial)

div is an html tag## The

#
tag can define a division or section (division/section) in the document, and is used to define a separated block or a regional part in the HTML document. The

tag is often used to group block-level elements so that they can be formatted with CSS.

tag can divide the document into independent and different parts. It can be used as a strict organizational tool and does not use any formatting associated with it. If
is marked with an id or class, the tag becomes more effective.

CSS refers to Cascading Style Sheet

CSS is a computer language used to express the style of documents such as HTML or XML. CSS can not only statically modify web pages, but can also cooperate with various scripting languages ​​to dynamically format various elements of web pages.

CSS can perform pixel-level precise control over the layout of element positions in web pages, supports almost all font size styles, and has the ability to edit web page objects and model styles.

div syntax:

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

css syntax:

.abc{设置CSS格局}
#bbb{配置CSS花样}
Copy after login

Next, use class or id in the div to introduce the corresponding CSS format within the curly braces.

<div class="abc">内容</div>
<div id="bbb">内容</div>
Copy after login

Example:

div tag application:

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

css:

div{font-size:20px}
Copy after login

The font size within the above configured div tag is 20px

CSS can be used to decorate divs, for example: div is a person and css is clothes.

The above is the detailed content of What is the difference between css and div. 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