首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    CSS基础学习(3)

    CSS-定位(一) 1-1 Position-statiic CSS关键属性—position 修饰全局DOM元素布局 static遵循默认的文档流布局,top,left,right,bottom.../Using_CSS_gradients 3-2 背景图片 给元素设置背景图片,及背景图片一些特性 /*添加图片*/ background-img: url(图片地址); /*设置背景图片重复*/...background-repeat: bo-repeat; repeat /*默认值 在垂直和水平方向进行重复*/ repeat-x /*在水平方向重复*/ repeat-y /*在垂直方向重复*/ no-repeat...完全适应宽度和高度*/ xpx ypx /*手动设置*/ x% y% cover 长宽中较小的一方撑满,contain 长宽较大的一方撑满 /*background合并写法*/ background: url...(https://style.youkeda.com/img/ykd-components/logo.png) no-repeat center / contain; 拓展 background-attachment

    1.2K30

    CSS3-边框和背景

    CSS3中边框和样式得到了增强。例如:可以创建圆角边框,使用图像边框,为元素创建阴影。.../images/border-image.png) 27 / 27px round repeat; border-image: url(.....可以为元素的每条边指定不同的宽度,不过此处只提供了一个值(27px),即四条边公用 二、设置元素的背景 属性 说明 值 background-color 设置元素的背景颜色,总是显示在背景图像下面 background-img...设置元素的背景图像,如果指定多个,后面的图像绘制在前面图像的下面 background-repeat 设置图像的重复样式 repeat-x、repeat-y、repeat、space、round、no-repeat...background-size 设置背景图像的尺寸 contain、cover、auto background-position 设置背景图像的位置 top、left、right、bottom、center

    2K31

    CSS3-边框和背景

    CSS3中边框和样式得到了增强。例如:可以创建圆角边框,使用图像边框,为元素创建阴影。.../images/border-image.png) 27 / 27px round repeat; border-image: url(.....可以为元素的每条边指定不同的宽度,不过此处只提供了一个值(27px),即四条边公用 二、设置元素的背景 属性 说明 值 background-color 设置元素的背景颜色,总是显示在背景图像下面 background-img...设置元素的背景图像,如果指定多个,后面的图像绘制在前面图像的下面 background-repeat 设置图像的重复样式 repeat-x、repeat-y、repeat、space、round、no-repeat...background-size 设置背景图像的尺寸 contain、cover、auto background-position 设置背景图像的位置 top、left、right、bottom、center

    1.2K20

    CSS从基础到熟练学习笔记(三)CSS中的5种背景属性(背景颜色、背景图片、固定背景图片等)

    语法background-image: url| none| initial| inherit; 属性值: url(‘URL’) 背景图片的地址,多张背景图片可以使用逗号隔开 none 默认值,无背景...background-repeat: no-repeat; } 如何定位背景图像background-position CSS可以通过background-position属性指定背景图片的位置...默认值为0% 0% 属性值: left top 左上角,如果仅仅制定一个值,则另一个值默认为center,即left left center。...类似的方式还有left center、left bottom、right top、right center、right bottom、center top、center center和center bottom...: center } 背景图片附着状态background-attachment CSS使用 background-attachment属性指明 背景附件属性来设置背景图像是否是固定的或是与页面的其余部分一起滚动

    2.3K10
    领券