Home  >  Article  >  Web Front-end  >  div, span and center elements in CSS_CSS/HTML

div, span and center elements in CSS_CSS/HTML

WBOY
WBOYOriginal
2016-05-16 12:11:132206browse

 

and are used to specify styles or bind scripts to content. Although most HTML elements can set style information through the style attribute, many HTML elements have their own default style, which may mix or even conflict with the style defined by style, which is something we don't want to see. For example: I am strong!. Unlike other HTML elements,
and do not have a default display style. So you can specify styles through them.

(1)

(division) is a block-level element that can contain paragraphs, titles, tables, and even chapters, summaries, notes, etc. Since it is a block-level element, a line break will be inserted at the beginning and end of the paragraph.
is used to set the position of the content block. You can use
to bind scripts or styles to any part of the document.

(2) Unlike

, is an inline element and does not cause line breaks. It is a logical inline grouping element. The most common way to use it is to use it to specify styles for several words or even certain characters in a piece of text.

(3) You can put the content that needs to be centered in the middle of

.
has the same effect as
.

Example: Use of element.

In this sentence some of the text is important!


Statement:
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