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

How to write asynchronous tasks in modern JavaScript

Preface In this article, we'll explore the ev...

Solution to the problem of saving format in HTML TextArea

The format of textarea can be saved to the databas...

How to solve the problem of margin overlap

1. First, you need to know what will trigger the v...

Practical MySQL + PostgreSQL batch insert update insertOrUpdate

Table of contents 1. Baidu Encyclopedia 1. MySQL ...

A brief discussion on CSS blocking merging and other effects

Non-orthogonal margins When margin is used, it wi...

JavaScript operation elements teach you how to change the page content style

Table of contents 1. Operation elements 1.1. Chan...

Dockerfile implementation code when starting two processes in a docker container

I want to make a docker for cron scheduled tasks ...

How to reduce image size using Docker multi-stage build

This article describes how to use Docker's mu...

Detailed tutorial on deploying Springboot or Nginx using Kubernetes

1 Introduction After "Maven deploys Springbo...

MySQL 5.7.10 installation and configuration tutorial under Windows

MySQL provides two different versions for differe...

Briefly describe the difference between Redis and MySQL

We know that MySQL is a persistent storage, store...

A brief discussion on VUE uni-app conditional coding and page layout

Table of contents Conditional compilation Page La...

About 3 common packages of rem adaptation

Preface I wrote an article about rem adaptation b...