css3学习笔记之用户界面

CSS3 调整尺寸(Resizing)

CSS3中,resize属性指定一个元素是否应该由用户去调整大小。

这个 div 元素由用户调整大小。 (在 Firefox 4+, Chrome, 和 Safari中)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html>
<head>
<style
div
{
border:2px solid;
padding:10px 40px; 
300px;
resize:both;
overflow:auto;
}
</style>
</head>
<body>
 
<b>调整前</b
<div>The resize property specifies whether or not an element is resizable by the user.</div>
<b>调整后</b
<div>The resize property specifies whether or not an element is resizable by the user.</div>
</body>
</html>

CSS3 方框大小调整(Box Sizing)

box-sizing 属性允许您以确切的方式定义适应某个区域的具体内容。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html>
<head>
<style
div.container
{
80%;
border:1em solid;
}
div.box
{
box-sizing:border-box;
50%;
border:1em solid red;
float:left;
}
</style>
</head>
<body>
 
<div class="container">
<div class="box">This div occupies the left half.</div>
<div class="box">This div occupies the right half.</div>
</div>
 
</body>
</html>

CSS3 外形修饰(outline-offset )

outline-offset 属性对轮廓进行偏移,并在超出边框边缘的位置绘制轮廓。

轮廓与边框有两点不同:

  • 轮廓不占用空间
  • 轮廓可能是非矩形
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
<style
div
{
margin:20px;
150px; 
padding:10px;
height:70px;
border:2px solid black;
outline:2px solid red;
outline-offset:15px;
</style>
</head>
<body>
 
<p><b>Note:</b> Internet Explorer does not support the outline-offset property.</p>
 
<div>This div has an outline border 15px outside the border edge.</div>
 
</body>
</html>

新的用户界面特性

属性说明CSS
appearance 允许您使一个元素的外观像一个标准的用户界面元素 3
box-sizing 允许你以适应区域而用某种方式定义某些元素 3
icon Provides the author the ability to style an element with an iconic equivalent 3
nav-down 指定在何处使用箭头向下导航键时进行导航 3
nav-index 指定一个元素的Tab的顺序 3
nav-left 指定在何处使用左侧的箭头导航键进行导航 3
nav-right 指定在何处使用右侧的箭头导航键进行导航 3
nav-up 指定在何处使用箭头向上导航键时进行导航 3
outline-offset 外轮廓修饰并绘制超出边框的边缘 3
resize 指定一个元素是否是由用户调整大小 3
原文地址:https://www.cnblogs.com/aiyoubucuoo/p/5437570.html