CSS3多列属性
-
column-count:将指定文本分割成几列
-
column-gap:指定文本分割后 列之间的间距
-
column-rule-style:指定文本分割后,设置分割线样式
-
column-rule-width:指定文本分割后,指定分割线的宽度
-
column-rule-color:指定文本分割后,指定分割线的颜色
-
column-rule:上面的简写
-
column-span:指定元素跨越列数
-
column-width:指定列的宽度
CSS3 用户界面
-
resize:指定一个元素是否应由用户去调整大小
-
box-sizing:允许您以确切的方式定义适应某个区域的具体内容。
-
outline-offset:对轮廓进行偏移,并在超出边框边缘的位置绘制轮廓。
新的用户界面特性
属性 | 说明 | |
---|---|---|
appearance | 允许您使一个元素的外观像一个标准的用户界面元素 | |
box-sizing | 允许你以适应区域而用某种方式定义某些元素 | |
icon | 为创作者提供了将元素设置为图标等价物的能力。 | |
nav-down | 指定在何处使用箭头向下导航键时进行导航 | |
nav-index | 指定一个元素的Tab的顺序 | |
nav-left | 指定在何处使用左侧的箭头导航键进行导航 | |
nav-right | 指定在何处使用右侧的箭头导航键进行导航 | |
nav-up | 指定在何处使用箭头向上导航键时进行导航 | |
outline-offset | 外轮廓修饰并绘制超出边框的边缘 | |
resize | 指定一个元素是否是由用户调整大小 |
CSS 图片
border-radius:设置圆角表框 用PX来设置,50%椭圆
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>缩略图</title>
<style>
a {
display: inline-block;
border: 1px solid #ddd;
border-radius: 4px;
padding: 5px;
transition: 0.3s;
}
a:hover {
box-shadow: 0 0 2px 1px rgba(0, 140, 186, 0.5);
}
</style>
</head>
<body>
<h2>缩略图作为连接</h2>
<p>我们使用 border 属性来创建缩略图。在图片外层添加一个链接。</p>
<p>点击图片查看效果:</p>
<a target="_blank" href="paris.jpg">
<img src="paris.jpg" alt="Paris" width="400" height="300">
</a>
</body>
</html>
图片 Modal(模态)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>模态窗口</title>
<style>
#myImg {
border-radius: 5px;
cursor: pointer; //光标样式
transition: 0.3s;
}
#myImg:hover {opacity: 0.7;}
/* The Modal (background) */
.modal {
display: none; /* 默认是隐藏的 */
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.9);
}
/* Modal Content (image) */
.modal-content {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
}
/* Caption of Modal Image */
#caption {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
text-align: center;
color: #ccc;
padding: 10px 0;
height: 150px;
}
/* Add Animation */
.modal-content, #caption {
-webkit-animation-name: zoom;
-webkit-animation-duration: 0.6s;
animation-name: zoom;
animation-duration: 0.6s;
}
@-webkit-keyframes zoom {
from {-webkit-transform: scale(0)}
to {-webkit-transform: scale(1)}
}
@keyframes zoom {
from {transform: scale(0.1)}
to {transform: scale(1)}
}
/* The Close Button */
.close {
position: absolute;
top: 15px;
right: 35px;
color: #f1f1f1;
font-size: 40px;
font-weight: bold;
transition: 0.3s;
}
.close:hover,
.close:focus {
color: #bbb;
text-decoration: none;
cursor: pointer;
}
/* 100% Image Width on Smaller Screens */
@media only screen and (max-width: 700px){
.modal-content {
width: 100%;
}
}
</style>
</head>
<body>
<h2>图片模态框</h2>
<img id="myImg" src="http://www.runoob.com/wp-content/uploads/2016/04/img_lights.jpg" alt="Northern Lights, Norway" width="300" height="200">
<!-- The Modal -->
<div id="myModal" class="modal">
<span class="close">×</span>
<img class="modal-content" id="img01">
<div id="caption"></div>
</div>
<script>
// 获取模态窗口
var modal = document.getElementById('myModal');
// 获取图片模态框,alt 属性作为图片弹出中文本描述
var img = document.getElementById('myImg');
var modalImg = document.getElementById("img01");
var captionText = document.getElementById("caption");
img.onclick = function(){
modal.style.display = "block";
modalImg.src = this.src;
modalImg.alt = this.alt;
captionText.innerHTML = this.alt;
}
// 获取 <span> 元素,设置关闭模态框按钮
var span = document.getElementsByClassName("close")[0];
// 点击 <span> 元素上的 (x), 关闭模态框
span.onclick = function() {
modal.style.display = "none";
}
</script>
</body>
</html>