三、CSS样式——背景
CSS背景
概念:CSS允许应用纯色作为背景,也允许使用背景图像创建相当复杂的效果。
| 属性 | 描述 |
| background-attachment | 背景图像是否固定或者随着页面的其余部分滚动 |
| background-color | 设置元素的背景颜色 |
| background-image | 把图片设置为背景 |
| background-position | 设置图片的起始位置 |
| background-repeat |
设置背景图片是否及如何重复 |
| background-size | 规定背景图片的尺寸 |
| background-origin | 规定背景图片的定位区域 |
| background-clip | 规定背景的绘制区域 |
<!--background.html-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
<p>test the background-color</p>
</body>
</html>
/*style.css*/
body{
/*background-color: khaki;*/
background-image: url("1.jpg");
background-repeat: no-repeat; /*图片不允许重复*/
/*background-position: right top;*/
/*background-position: 100px 100px;*/
/*background-attachment: fixed;*/
background-size: 100px 100px;
/*right和center*/
} p{
width: 150px;
padding: 10px;
background-color: blueviolet;
}
三、CSS样式——背景的更多相关文章
- 3月22日 html(三)css样式表
CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页. 一.样式表 (一)样式表的分类 1.内联样式表 和HTML联合显示,控制精确,但是可重用性差,冗余较多. 例 ...
- WEB入门三 CSS样式表基础
学习内容 Ø CSS的基本语法 Ø CSS选择器 Ø 常见的CSS样式 Ø 网页中3种使用CSS的方式 能力目标 Ø 理解CSS的 ...
- 第六篇 CSS样式 背景、背景图、文本、链接
元素背景.文本(字体)样式.链接 这里我们只学习常用的一些,更多的扩展就要同学们自己去了解,或者下方评论. 这里我们为了简便,用的是CSS的内嵌形式. 元素背景: 我们写模块的时候,有的时候为了区 ...
- css样式背景图片设置缩放
一.背景颜色图片平铺 background-color 背景颜色 background-image 背景图片地址 background-repeat 是否平铺 默认是平铺 background-pos ...
- 前端学习笔记--CSS样式--背景和超链接
1.背景 2.超链接: 举例:
- css样式之背景图片
1.css样式背景之使用图片来做为背景 example: <!DOCTYPE html> <html> <head> <meta http-equiv=&qu ...
- HTML基础(三)——css样式表
CSS(Cascading Style Sheet,叠层样式表),作用是美化HTML网页. /*注释区域*/此为注释语法 一.样式表 (一)样式表的分类 1.内联样式表 和HTML联合显示,控制精确, ...
- PHP.9-HTML+CSS(三)-CSS样式
CSS样式 CSS是Cascading Style Sheets的简写,它除了可以轻松设置网页元素的显示位置和格式处,甚至还能产生滤镜,图像淡化,网页淡入淡出的渐变效果.CSS就是要对网页的显示效果实 ...
- Bootstrap入门(三)<p>标签的css样式
Bootstrap入门(三)<p>标签的css样式 前提:引入css文件,内容放在一个class为container的div中 <p>标签属性 1.“ text-left ...
随机推荐
- Html中video的属性和方法大全
<video>标签的属性 src :视频的属性 poster:视频封面,没有播放时显示的图片 preload:预加载 autoplay:自动播放 loop:循环播放 controls:浏览 ...
- 在c#中 RemoveAt、 Remove、delete用法区别
有三种方法可以删除 DataTable 中的 DataRow: Delete 方法和 Remove 方法和 RemoveAt 方法 其区别是: Delete 方法实际上不是从 DataTable 中删 ...
- python 7
一.数据类型的补充 1.元组 tu1 = ('大海') tu2 = ('大海',) print(tu1, type(tu1), tu2, type(tu2)) 大海 <class 'str'&g ...
- Python之字符串函数str()
str()方法使Python将非字符串值表示为字符串: age = 23 message = "Happy" + str(age) +"rd Birthday"
- .NET数据采集
public string GetHttpData(string Url) { string sException = null; string sRslt = null; WebResponse o ...
- ue4 StringTable
StringTable 用法很简单可以参考 https://blog.csdn.net/u012801153/article/details/80393531 这里只说说上面文章中没提到的小技巧 T ...
- AJAX实现登陆
先添加点击事件 <input type="button" id="submitt" value="立即登录" /> 展示信息 & ...
- Centos7安装Docker CE
每次安装Docker都要去找文档,或者每次安装的都不一样,还是要好好管理自己的这些东西,下次用的时候可以省很多的时间 Docker的早期版本称为docker或docker-engine:现在的 ...
- [转]Java调用Javascript、Python算法总结
最近项目中经常需要将Javascript或者Python中的算法发布为服务,而发布Tomcat服务则需要在Java中调用这些算法,因此就不免要进行跨语言调用,即在Java程序中调用这些算法. 不管是调 ...
- vue 中结合百度地图获取当前城市
首先需要去百度地图开发者平台申请 ak http://lbsyun.baidu.com/index.php?title=%E9%A6%96%E9%A1%B5 在index.html 中引入script ...