html元素类型 块级元素、内联元素(又叫行内元素)和内联块级元素。_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:32:42
Original
1796 people have browsed it

html中的标签元素大体被分为三种不同的类型:块级元素、内联元素(又叫行内元素)和内联块级元素。

块级元素特点:

1、每个块级元素都从新的一行开始,并且其后的元素也另起一行。(霸道,一个块级元素独占一行)

2、元素的高度、宽度、行高以及顶和底边距都可设置。

3、元素宽度在不设置的情况下,是它本身父容器的100%(和父元素的宽度一致)

常用的块状元素有:

...

    、、

    设置display:block;可以将元素转换块级元素。

    内联元素特点:

    1、和其他元素都在一行上;

    2、元素的高度、宽度及顶部和底部边距不可设置;

    3、元素的宽度就是它包含的文字或图片的宽度,不可改变。

    常用的内联元素有:


    设置display:inline;可以将块状元素转换为内联元素

    内联块级元素特点:(同时具备内联元素、块级元素的特点)


    1、和其他元素都在一行上;

    2、元素的高度、宽度、行高以及顶和底边距都可设置!

    常用的内联块状元素有:

    html元素类型 块级元素、内联元素(又叫行内元素)和内联块级元素。_html/css_WEB-ITnose

    display:inline-block;float:left / right;position:absolute/fixed;可以将元素设置为内联块级元素。

     

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
Popular Tutorials
More>
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!