您的位置:首页 > Web前端 > HTML5

蓝鸥零基础学习HTML5第九讲 兼容性六

2016-09-28 13:15 375 查看
蓝鸥零基础学习HTML5第九讲 兼容性六

1.兼容性16

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Document</title>

<style>

.box {

width:200px;

height:200px;

border:1px solid #000;

position: relative;

}

.box span {

width:20px;

height:20px;

background: yellow;

position: absolute;

right:-1px;

bottom:-1px;

}

</style>

</head>

<body>

<!--

在IE6下,如果绝对定位的父级宽高是奇数的时候,子级元素的right和bottom值会有1px的偏差

 -->

<div class="box">

<span></span>

</div>

</body>

</html>



2.兼容性17

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Document</title>

<style>

body {

height: 2000px;

background: red;

}

.box {

width:200px;

height: 200px;

background: yellow;

position: fixed;

top:30px;

left:100px;

opacity: 0.5;

filter:alpha(opacity=50);

}

</style>

</head>

<body>

<div class="box"></div>

</body>

</html>



3.兼容性18

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Document</title>

<style>

.box {

width:200px;

height:32px;

border:1px solid #000;

}

input {

width:100px;

height:30px;

border:1px solid blue;

margin:0;

padding:0;

float:left;

}

</style>

</head>

<body>

<!--

在IE6.7下 输入型的表单标签控件上下会有1px的间隙。

 

处理方法:给input加浮动

 -->

<div class="box">

<input type="text">

</div>

</body>

</html>

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  css html html5 蓝鸥 龙江