900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > css中背景相关的属性是哪些?css背景属性的介绍

css中背景相关的属性是哪些?css背景属性的介绍

时间:2018-10-18 02:35:50

相关推荐

css中背景相关的属性是哪些?css背景属性的介绍

web前端|css教程

CSS

web前端-css教程

数字钱包源码,VScode文件启动的路径,ubuntu异机,tomcat加载js不全,fiddler爬虫使用,php代码被注释掉,seo新手怎样做外推,dede双语网站,免费手机制作模板lzw

css背景有哪些相关属性?下面本篇文章给大家带来关于css背景属性的介绍,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

排班软件源码,vscode代码提醒插件,ubuntu 光盘修复,tomcat诞生的意义,unsplash 爬虫,php 网络直播,阳泉网络营销seo,怎么在网站上制作自动弹出客服,php源码模板lzw

1、css背景属性之为内容设置背景色:background-color;

属性:

颜色;

inherit;继承父级样式

微信销售平台源码,vscode代码颜色怎么调,老毛桃ubuntu,tomcat的配制方法,ins照片爬虫,php 转换成utf-8,seo优化师是怎么样,二维码在线生成网站带头像,html5模板 waplzw

box.html

背景<p为内容设置背景色:background-color;

box.css

body{ background-color:#123456;}

2、css背景属性之为内容设置背景为图片background-image:url();

box.css

body{ background-color:#123456; background-image:url(image.jpg); }

3、css背景属性之固定背景图片background-attachment

(在CSS中使用 background-attachment属性可以将图片固定在浏览器上,如果拖动滚动条,背景图片不会随着网页内容的滚动而滚动,像文字浮在图片上)

属性值:

scroll;背景图片随内容滚动,默认值

fixed; 背景图片固定,不随内容滚动

inherit;继承父类样式

box.css

body{ background-color:#123456; background-image:url(image.jpg); background-attachment:fixed; font-size: 45px; }

4、css背景属性之背景图片平铺background-repeat;

属性值:

repeat;平铺背景图片;默认

no-repeat;不平铺图片;

repeat-x;在水平方向平铺

repert-y;在竖直方向平铺

box.css

body{background-color:#123456; background-image:url(image.jpg); background-attachment:fixed; font-size: 45px; background-repeat: repeat-y; }

5、css背景属性之背景图片定位background-position

属性值:

top;顶部

center;中间

bottom;底部

right;右边

left;左边

inherit;继承父类样式

样式:

xxxpx,xxxpx;

xxx%,xxx%;

xxxpx,top;

box.css

body{ background-color:#123456; background-image:url(image.jpg); background-attachment:fixed; font-size: 45px; background-repeat:no-repeat; background-position:left; }

你不知道的CSS背景—css背景属性全解

详解css之背景background属性

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。