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

Problems and solutions when installing and using VMware

The virtual machine is in use or cannot be connec...

10 Best Practices for Building and Maintaining Large-Scale Vue.js Projects

Table of contents 1. Use slots to make components...

How to Easily Remove Source Installed Packages in Linux

Step 1: Install Stow In this example, we are usin...

JS implements the dragging and placeholder functions of elements

This blog post is about a difficulty encountered ...

A brief introduction to the command line tool mycli for operating MySQL database

GitHub has all kinds of magic tools. Today I foun...

JavaScript clicks the button to generate a 4-digit random verification code

This article example shares the specific code of ...

How to install Docker on Windows Server 2016

Recently Microsoft released Windows Server 2016, ...

How many ports can a Linux server open at most?

Table of contents Port-related concepts: Relation...

Detailed explanation of JavaScript implementation of hash table

Table of contents 1. Hash table principle 2. The ...

Detailed explanation of the entry-level use of MySql stored procedure parameters

Use of stored procedure in parameters IN paramete...

vue+element-ui implements the head navigation bar component

This article shares the specific code of vue+elem...

MySQL-8.0.26 Configuration Graphics Tutorial

Preface: Recently, the company project changed th...

30 minutes to give you a comprehensive understanding of React Hooks

Table of contents Overview 1. useState 1.1 Three ...