background 背景

  背景颜色

/*背景颜色为红色*/
p {
background-color:ren;
}

网页背景不仅可以设置颜色还可以插入图片

/*为背景插入图片*/
body {
background:url("./1.jpg")
/*括号中可以不加引号,但是加上还是好的
      备注 标签请求外面资源 有三种属性 href src url
    */
}

在背景中插入照片(可以在body  table...插入)时会出现平铺现象(当照片小于背景尺寸)

  背景平铺 属性background-repeat

    值:no-repeat(不平铺)

      repeat(平铺)

     repert-x(横向平铺)

     repeat-y(纵向平铺)

(以上四张图片来源w3school)

    设置背景大小 background-size

p {
background-size:200px 200px;
/*背景大小为200*200
*
*属性值可以为像素大小
* 也可以设置为自适应auto
*
*/
}

    调整背景位置 background-position

body {
background-position:50% 50%;
/*
*背景位置为居中
* 背景位置也就是坐标轴
* 注意:向下为正,向右为正;
*也可设置像素
* eg:20px 20px;
*/
}

background 背景认知的更多相关文章

  1. css中background背景属性概

    css中background背景属性概 background:url(背景图片路径)  no-repeat;/*不重复默认在左上方*/background:url(背景图片路径)  no-repeat ...

  2. css 使用background背景实现border边框效果

    css中,我们一般使用border给html元素设置边框,但也可以使用background背景来模拟css边框效果,本文章向大家介绍css 使用background背景实现border边框效果,需要的 ...

  3. [CSS]background背景

    css背景样式 序号  中文说明  标记语法  1  背景颜色  {background-color:数值}  2  背景图片  {background-image: url('imgpath/img ...

  4. 【C#/WPF】Button按钮动态设置Background背景颜色

    学习笔记: 在XAML中给Button设置颜色大家都懂的,本篇只是记录用C#代码动态生成的按钮设置Background背景颜色. new一个Button,设置Background时可看到该属性类型是S ...

  5. css background 背景知识详解

    background 背景属性 我们知道元素有前景色color,与之对应的还有背景色,通过background我们可以为元素添加实色(background-color)和任意多个背景图片(backgr ...

  6. 【Python全栈-CSS】background背景

    background背景 一.背景图片 background-image: url("img/num.png"); background-position-x: -200px ; ...

  7. background 背景类八大属性

    background 背景类八大属性 背景颜色(当同时定义了背景颜色和背景图像时,背景图像覆盖在背景颜色之上) background-image:背景图像 background-repeat:背景图像 ...

  8. 解决android:background背景图片被拉伸问题

    ImageView中XML属性src和background的区别: background会根据ImageView组件给定的长宽进行拉伸,而src就存放的是原图的大小,不会进行拉伸.src是图片内容(前 ...

  9. CSS样式表之background背景

    [CSS常用背景属性]:background (缩写形式) background-color:背景色 background-image:背景图  url中放图片地址,背景图和背景色同时存在时,背景图覆 ...

随机推荐

  1. NodeJS学习笔记 (10)网络TCP-net(ok)

    模块概览 net模块是同样是nodejs的核心模块.在http模块概览里提到,http.Server继承了net.Server,此外,http客户端与http服务端的通信均依赖于socket(net. ...

  2. 苹果下一代iPhone曝光

    3月23日消息,据9TO5Mac报道,苹果下一代iPhone(以下暂命名为iPhone 11)可能会提供像三星Galaxy S10的PowerShare功能,能为Apple Watch和AirPods ...

  3. python_webApp

    提高开发效率:当更改代码后,不重启服务器就能使用新效果 参考链接:https://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df ...

  4. 洛谷 P3434 [POI2006]KRA-The Disks

    P3434 [POI2006]KRA-The Disks 题目描述 For his birthday present little Johnny has received from his paren ...

  5. ArcGIS api for javascript——渲染-使用唯一值渲染

    描述 本例使用唯一值渲染器来作为美国的符号.每个州有一个字符串属性"SUB_REGION"表示它的国家的地区.UniqueValueRenderer.addValue()方法被用来 ...

  6. 用C3P0建立server与数据库的连接

    1:在MyEclipse建立 Web Service Project 2:在project中建立servlets包 3:在包中新建Servlet文件(採用new Servlet方法可省去配置web.x ...

  7. POJ 1258 Agri-Net (最小生成树+Prim)

    Agri-Net Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 39820   Accepted: 16192 Descri ...

  8. 数据格式转换 (三)Office文档转HTML

         HTML Filter 是由北京红樱枫软件有限公司根据HTML Ver 4.01/CSS式样,研制和开发的MS Office系列文档到HTML转换的通用程序库.便于用户实现对多种文档的统一管 ...

  9. Lesson 1 Basic Concepts: Part 3

    A cheaper option Some people may not want to buy a domain or pay for hosting because they only have ...

  10. Delegates, Events, and Anonymous Methods 委托、事件与匿名方法

    http://www.cnblogs.com/r01cn/archive/2012/11/30/2795977.html