岁月静好_94
chyco
是不是因为absolute的原因啊...
慕瓜8892989
简单的情况text-align:center; vertical-align: middle等,下面是复杂一点的:
// 方法一:已知元素的高宽
<div></div>
CSS:
.content{
background-color:#6699FF;
width:200px;
height:200px;
position: absolute;
top: 50%;
left: 50%;
/* 二分之一的负height,width */
margin-top:-100px ;
margin-left: -100px;
}
//方法二:未知元素的高宽
<div></div>
CSS:
.content{
background-color:#6699FF;
width:200px;
height:200px;
position: absolute;
/* transform: translate(-50%,-50%) 或 margin:auto与四边距相等 */
margin:auto; /*无这个就只有top、left起作用*/
top: 0;
left: 0;
bottom:0;
right: 0;
}
//3,两个按钮在div中居中,并相距一定距离
<style type="text/css">
div{width: 600px;height: 500px;background-color: rgba(240,240,240,0.9);text-align:
center;}
.button{ width:100px;height: 90px;background-color: #f00;position: relative;top: 50%;
transform: translate(0,-50%) }
.button1{margin-left: 0;margin-right: 100px;}
.button2{margin-right: 0;}
</style>
</head>
<body>
<div>
<input type="button" class="button button1"></input>
<input type="button" class="button button2"></input>
</div>
鱿鱼
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
#div1{line-height:300px;background:gray;text-align: center;}
#div1>img{vertical-align: middle;}
</style>
</head>
<body>
<div id="div1">
<img src="images/css.jpg"/>
</div>
</body>
</html>
qq_非诚勿扰_3
呵呵,拿积分的
慕粉18833243792
看看是不是网断了==
慕粉3251612
这个网站学前端基础还是很不错的,网易云的课程很乱,耐心学吧
0154048潘世鑫

默认播放器改成html5

右下角有变速
北漂客
line-height:normal;即可
其修远兮
这样?

hero_猎
http://www.zhangxinxu.com/wordpress/
SCAU_KK
ElvisSir
网页的视频播放器是怎么做的?如何兼容苹果和安卓的呢?
qq_王小叔_0
说话断断续续的,,,,,,,说的时候又特别快,,,,,,,,,,,,,,,风格蛮喜欢的
qq_王小叔_0
老师可能在暗示哟
summerguo
嗯,老师是个天性快乐的人吧