The span tag is often used when making HTML web pages, but some friends have trouble using this tag. Many friends seem to think it is easy to use, but it is very troublesome to use, especially when it is necessary to define the width and height.
A friend once asked: Why after defining the height and width of a span with CSS, its width and height still do not change, as if it has failed?
In fact, this problem is very simple - you must first understand the attributes of span, because span is an inline element, and inline elements ignore width and height. Once you understand this, the solution is very simple. Solve The best way is to use css to turn span into a boxed element.
There are two ways to define an inline element as a boxed element:
1. Directly use the display attribute to define it as a boxed element;