Home > Web Front-end > HTML Tutorial > How to set the width attribute for the span tag style_HTML/Xhtml_Web page production

How to set the width attribute for the span tag style_HTML/Xhtml_Web page production

WBOY
Release: 2016-05-16 16:38:44
Original
1657 people have browsed it

If you directly set the width attribute to the span tag style, you will find that it will not have any effect.

If display:block is set, the width attribute takes effect, but the span at this time is the same as the div.
If display:inline-block is set, the spans will be listed in the same row, and the width attribute will take effect. Common value descriptions for the

element display attribute:

1) block: The default value of the block object. Forces the object to be rendered as a block object, adding a new line after the object.
2) inline: The default value of inline objects. Forces the object to be rendered as an inline object, removing rows from the object.
3) inline-block: Render the object as an inline object, but the content of the object is rendered as a block object. Adjacent inline objects will be rendered on the same line.
4) non: hidden object. Unlike the hidden value of the visibility property, it does not reserve its physical space for the hidden object.

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