3 4 5"> Summarize three methods of converting inline elements to block-level elements-HTML Tutorial-php.cn

Summarize three methods of converting inline elements to block-level elements

零下一度
Release: 2017-06-28 09:35:35
Original
6707 people have browsed it

The following summarizes three methods for converting inline elements to block-level elements:

(1)display

(2)float

(3)position(absolute and fixed)

Speak less and do more, run the following code to see the effect:

1  2  3  4  5  6 行内元素转为块级元素 7 27 
28 29
30 方法一:使用display31
32 a标签转为块级元素33
34 方法一:使用float35
36 span标签转为块级元素37
38 方法一:使用position(absolute和fixed)39
40 i标签转为块级元素41 42
Copy after login

Check whether it is converted to a block-level element by inspecting the element:

The above is the detailed content of Summarize three methods of converting inline elements to block-level elements. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!