欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

純CSS實(shí)現(xiàn)DIV懸浮的示例代碼(固定位置)

  發(fā)布時(shí)間:2021-01-07 16:01:53   作者:ssxueyi   我要評論
這篇文章主要介紹了純CSS實(shí)現(xiàn)DIV懸浮的示例代碼(固定位置),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧

純CSS實(shí)現(xiàn)的DIV懸浮效果(固定位置),兼容常用的瀏覽器:IE8、360、FireFox、Chrome、Safari、Opera、傲游、搜狗、世界之窗等。效果如下:

實(shí)現(xiàn)代碼:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>DIV懸浮示例-純CSS實(shí)現(xiàn)</title>
<style type="text/css">
/*設(shè)置了高度,可以上下滾動*/
body {
height: 1800px;
background:#dddddd;
}

/*div通用樣式*/
div{
background: #1a59b7;
color:#ffffff;
overflow: hidden;
z-index: 9999;
position: fixed;
padding:5px;
text-align:center;
width: 175px;
height: 22px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}

/*右上角*/
div.right_top{
right: 10px;
top: 10px;
}

/*右下角*/
div.right_bottom{
right: 10px;
bottom: 10px;
}

/*屏幕中間*/
div.center_{
right: 45%;
top: 50%;
}

/*左上角*/
div.left_top{
left: 10px;
top: 10px;
}

/*左下角*/
div.left_bottom{
left: 10px;
bottom: 10px;
}
</style>
</head>
<body >
<div class="right_top"> 我是右上角懸浮的div</div>
<div class="right_bottom"> 我是右下角懸浮的div</div>
<div class="center_"> 我是屏幕中間懸浮的div</div>
<div class="left_top"> 我是左上角懸浮的div</div>
<div class="left_bottom"> 我是左下角懸浮的div</div>
</body>
</html>

到此這篇關(guān)于純CSS實(shí)現(xiàn)DIV懸浮的示例代碼(固定位置)的文章就介紹到這了,更多相關(guān)CSS DIV懸浮內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論