Joke Collection Website - Bulletin headlines - Span style alignment in CSS
Span style alignment in CSS
Method 1: Set the display property of span to block.
& ltspan style = " font-size: 14px; Text alignment: centered; Show: block; " & gt...& lt/span>。
Method 2: Set the display attribute of span to inline-block, which requires setting the width of span manually.
& ltspan style = " font-size: 14px; Text alignment: centered; Display: embedded-block; Width: 500 pixels; " & gt...& lt/span>。
Extended data
According to the display form of elements, html tags are mainly divided into block elements and inline elements.
Characteristics of massive elements:
1, always starting from a new line.
2. You can control the height, line height, outer margin and inner margin.
3. Unless the width is set, the default width is 100% of its container.
4. It can accommodate in-line elements and other block elements.
Embedded element function:
1, all other elements are on one line.
2. The height, outer margin and inner margin cannot be changed.
3. The width is the width of its text or picture and cannot be changed.
4. In-line elements can only save text or other in-line elements.
References:
Baidu Encyclopedia-Block Elements
Baidu encyclopedia-inline elements
- Related articles
- Responsibility book for safety production in agricultural parks
- What does "Together we fight against the epidemic and wait for the flowering period" mean?
- What problems should I pay attention to when opening a fresh supermarket?
- Indoor slogans on security doors
- Ask for a slogan that rhymes with domineering
- The world's national handwritten newspaper looks forward to the future on the first day of the new year, and *** moves forward together
- List of spring conscripts in Xiangyin County, Hunan Province in 2022
- Campus stall festival slogan
- What actions are disturbing public order?
- Teaching paper number 1 1 14