html页面背景设定相关
2024-09-21 07:13:37
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>背景</title> <style>
div{
width: 300px;
height: 300px;
border: 10px solid red;
background-image:url(https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1493309945592&di=b3051d0bce128fd8b75d9c0b9c2ee033&imgtype=0&src=http%3A%2F%2Fpic67.nipic.com%2Ffile%2F20150514%2F21036787_181947848862_2.jpg) ;
background-size: cover;
}
/*img{
width: 100%;
height: 100%;
}*/ </style>
</head>
<body>
<!--
若容器没设置宽高
容器中的内容可以把容器撑起来
但背景不会占用容器的宽高
-->
<div>
<!--<img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1493309945592&di=b3051d0bce128fd8b75d9c0b9c2ee033&imgtype=0&src=http%3A%2F%2Fpic67.nipic.com%2Ffile%2F20150514%2F21036787_181947848862_2.jpg" />-->
</div>
</body>
</html>
<!--
background 背景
background-color 背景色
background-image 背景图片
background-repeat 背景图片是否重复
background-position 背景位置
background-attachment 背景图片是否滚动
-->
<!--
background-position:;
传两个参数
分别代表X和Y
可以直接传参数例如
background-position:10px 10px;
也可以传关键字
X关键字有:Center,left,right//分别代表中间,左边,右边
Y关键字有:top,center,bottom//分别代表上边,中间,下边 若不传参数,则默认0px 0px或者left top
-->
<!--
background-attachment:;
scoll 背景滚动(默认属性)
fixed 背景固定
-->
<!--
背景还可以按照复合属性写法来写
-->
最新文章
- 利用AOP写2PC框架(二)
- Tomcat 利用server.xml进行其他盘符的其他项目映射的部署以及JSP引用其他盘符的图片(虚拟目录及虚拟路径)
- 获得appstore里面app的最新的版本信息,进行版本更新
- python :模态对话框
- centos 带S权限的二进制
- 在ListActivity中显示图标
- SQL Server 2012实施与管理实战指南(笔记)——Ch6连接的建立和问题排查
- iOS运行时与method swizzling
- Material Design Button 样式
- elasticsearch-查询的基本语法
- IBatis.Net 批量插入数据
- 解决windows 10 9926 中vmware安装的虚拟机无法桥接上网的问题
- ROS_Kinetic_x ROS栅格地图庫 Grid Map Library
- scrollview中edittext失去焦点问题
- k8s实战读书笔记
- php-fpm的pool php-fpm慢执行日志 open_basedir php-fpm进程管理
- java开发编译器:中间语言格式
- Tomcat启动慢原因之二 he APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
- Jenkins启动Tomcat时提示Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
- Could not find com.android.support.constraint:constraint-layout的问题解决
热门文章
- oracle数据库创建分区表
- 桌面管理工具 RedisDesktopManager 0.8.8
- lucene的suggest(搜索提示功能的实现)
- hdoj6483 A Sequence Game(ST预处理RMQ+莫队)
- 一篇入门 -- Scala
- C#6.0语言规范(二) 词法结构
- Ubuntu 13.10下安装ns2 2.35遇到的小问题
- mysql快熟入门
- centos7使用lldb调试netcore应用转储dump文件
- Python——pytessercat识别简单的验证码