How to set the width attribute to the style of the span tag

How to set the width attribute to the style of the span tag
If you directly set the width attribute to the style of the span tag, you will find that it has no effect.

If display:block is set, the width attribute takes effect, but the span is now the same as the div.
If display:inline-block is set, span is placed in the same row and the width property takes effect.

Common values ​​of the element display attribute:

1) block: The default value of the block object. Forces the object to be rendered as a block object, appending a newline after the object.
2) inline: The default value for inline objects. Forces the object to be rendered as an inline object, removing the lines from the object.
3) inline-block: Renders the object as an inline object, but the content of the object is rendered as a block object. Adjacent inline objects are rendered on the same line.
4) non: hidden object. Unlike the hidden value of the visibility property, no physical space is reserved for the hidden object.

<<:  Solve the problem that the name of the type=file file modification form cannot be echoed normally

>>:  MySQL 8.0.25 decompression version installation and configuration method graphic tutorial

Recommend

Example code of CSS layout at both ends (using parent's negative margin)

Recently, during the development process, I encou...

Conditional comments to determine the browser (IE series)

<!--[if IE 6]> Only IE6 can recognize <![...

Beginners learn some HTML tags (2)

Related article: Beginners learn some HTML tags (1...

The process of installing MySQL 8.0.26 on CentOS7

1. First, download the corresponding database fro...

Using CSS3 to implement font color gradient

When using Animation.css, I found that the font o...

Vue implements the countdown component for second kills

This article shares the specific code of Vue to i...

About React Native unable to link to the simulator

React Native can develop iOS and Android native a...

How to write transparent CSS for images using filters

How to write transparent CSS for images using filt...

MySQL optimization strategy (recommended)

In summary: 1. Consider performance when designin...

Problems with creating placeholders for HTML selection boxes

I'm using a placeholder in a text input and i...

Detailed explanation of FTP environment configuration solution (vsftpd)

1. Install vsftpd component Installation command:...

Linux redis-Sentinel configuration details

download Download address: https://redis.io/downl...