The span tag is often used when making HTML web pages, but some friends don’t know how to use this tag well. They think it is easy to use, but troublesome to use, especially when they need to define its width and height. A friend once asked me: Why after defining the height and width of span with CSS, its width and height still do not change, as if they are invalid? In fact, this problem is very simple - first you need to understand the properties of span, because span is an inline element, and inline elements ignore width and height. Once you understand this, the solution is very simple. The solution 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. Use the display attribute display directly to define it as a boxed element; Copy code The code is as follows:display:block; 2. Use the float attribute to automatically define it as a boxed element; Copy code The code is as follows:float:left; |
<<: Detailed usage of docker-maven-plugin
>>: Introduction to commonly used fonts on the Web (fonts supported by iOS and Android browsers)
To merge the following two files, merge them toge...
Copy code The code is as follows: <style type=...
Table of contents 1. Download steps 2. Configure ...
This article shares the specific code of react+an...
1. Introduction Sometimes, after the web platform...
Before reading this article, I hope you have a ba...
Permissions and database design User Management U...
In js, set the user to read a certain agreement b...
As shown below: XML/HTML CodeCopy content to clip...
Table of contents 1. Background 2. Verification p...
There has been a lot of discussion about H1 recent...
General mobile phone style: @media all and (orien...
First of all, we need to understand that GB2312, ...
<br />Original: http://www.alistapart.com/ar...
The previous article was a simple review of the B...