欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

W3School-CSS 分类 (Classification) 实例_html/css_WEB-ITnose

程序员文章站 2022-04-22 13:16:12
...

CSS 分类 (Classification) 实例

CSS 实例

  • CSS 背景实例
  • CSS 文本实例
  • CSS 字体(font)实例
  • CSS 边框(border)实例
  • CSS 外边距 (margin) 实例
  • CSS 内边距 (padding) 实例
  • CSS 列表实例
  • CSS 表格实例
  • 轮廓(Outline)实例
  • CSS 尺寸 (Dimension) 实例
  • CSS 分类 (Classification) 实例
  • CSS 定位 (Positioning) 实例
  • CSS 伪类 (Pseudo-classes)实例
  • CSS 伪元素 (Pseudo-elements)实例
  • 01如何把元素显示为内联元素和块级元素

        01如何把元素显示为内联元素和块级元素

    我这个段落被设置为内联元素。我这个段落被设置为内联元素。我这个段落被设置为内联元素。

    哥俩好,我也是inline元素!哥俩好,我也是inline元素!哥俩好,我也是inline元素!

    我不是p而是div,所以内容不会显示出来!

    我是一个段落随便写点啥我是一个段落随便写点啥我这个span元素被设置为块级元素。。块级元素。。!!我是一个段落随便写点啥我是一个段落随便写点啥一个段落随便写点啥我是一个段落随便写点啥我是一个段落随便写点啥我是一个段落随便写点啥所以我们两个span元素就换行了。。换行了。。!!我是一个段落随便写点啥我是一个段落随便写点啥我是一个段落随便写点啥

    02浮动属性的简单应用

        02浮动属性的简单应用

    W3School-CSS 分类 (Classification) 实例_html/css_WEB-ITnose This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

    03将带有边框和边界的图像浮动于段落的右侧

        03将带有边框和边界的图像浮动于段落的右侧

    W3School-CSS 分类 (Classification) 实例_html/css_WEB-ITnose This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

    04带标题的图像浮动于右侧

        04带标题的图像浮动于右侧
    W3School-CSS 分类 (Classification) 实例_html/css_WEB-ITnose
    CSS is fun!

    This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

    05使段落的首字母浮动于左侧

        05使段落的首字母浮动于左侧

    This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

    在上面的段落中,文本的第一个字母包含在一个 span 元素中。这个 span 元素的宽度是当前字体尺寸的 0.7 倍。span 元素的字体尺寸是 400%,行高是 80%。span 中的字母字体是 "Algerian"

    06创建水平菜单

        06创建水平菜单

    在上面的例子中,我们把 ul 元素和 a 元素浮向左浮动。li 元素显示为行内元素(元素前后没有换行)。这样就可以使列表排列成一行。ul 元素的宽度是 100%,列表中的每个超链接的宽度是 7em(当前字体尺寸的 7 倍)。我们添加了颜色和边框,以使其更漂亮。

    07创建无表格的首页

        07创建无表格的首页

    浣溪沙·一曲新词酒一杯

    听一支新曲喝一杯美酒,还是去年的天气旧日的亭台,西落的夕阳何时再回来?

    浣溪沙·一曲新词酒一杯

    一曲新词酒一杯,去年天气旧亭台。夕阳西下几时回?

    无可奈何花落去,似曾相识燕归来。小园香径独徘徊。

    08定位:相对定位

        08定位:相对定位

    我是位于正常位置的标题,相对定位会按照我的原始位置对我进行移动

    样式 "left:-20px" 从我的左侧位置减去 20 像素

    样式 "left:50px" 向我的左侧位置增加 50 像素

    09定位:绝对定位

        09定位:绝对定位

    我是带有绝对定位的标题

    通过绝对定位,元素可以放置到页面上的任何位置。下面的标题距离页面左侧 100px,距离页面顶部 150px。

    10定位:固定定位

        10定位:固定定位

    一些文本。

    更多的文本。

    11如何使元素不可见

        11如何使元素不可见

    这是可见的标题

    这是不可见的标题

    12把表格元素设置为collapse

        12把表格元素设置为 collapse
    中国?? 日本??
    美国?? 俄罗斯??

    13改变光标

        13改变光标

    请把鼠标移动到单词上,可以看到鼠标指针发生变化:

    Auto
    Crosshair
    Default
    Pointer
    Move
    e-resize
    ne-resize
    nw-resize
    n-resize
    se-resize
    sw-resize
    s-resize
    w-resize
    text
    wait
    help

    14清除元素的侧面

        14清除元素的侧面W3School-CSS 分类 (Classification) 实例_html/css_WEB-ITnoseW3School-CSS 分类 (Classification) 实例_html/css_WEB-ITnose

    CSS 分类 (Classification)总结