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

Detailed explanation of the construction and use of Docker private warehouse

The image can be saved on hub.docker.com, but the...

Solve the problem of Navicat for Mysql connection error 1251 (connection failed)

Because what I wrote before was not detailed enou...

How to run Spring Boot application in Docker

In the past few days, I have studied how to run s...

css Get all elements starting from the nth one

The specific code is as follows: <div id="...

Detailed tutorial on deploying Django project under CentOS

Basic Environment Pagoda installation service [Py...

Detailed explanation of semiotics in Html/CSS

Based on theories such as Saussure's philosop...

Memcached method for building cache server

Preface Many web applications store data in a rel...

MAC+PyCharm+Flask+Vue.js build system

Table of contents Configure node.js+nvm+npm npm s...

How to install tomcat8 in docker

1. Install tomcat8 with docker 1. Find the tomcat...

Div nested html without iframe

Recently, when doing homework, I needed to nest a ...

After docker run, the status is always Exited

add -it docker run -it -name test -d nginx:latest...

Solve MySQL login error: 'Access denied for user 'root'@'localhost'

First of all, I don't know why I can't lo...