css如何让视频居中

html-css015

css如何让视频居中,第1张

<html>

<head><title></head></title>居中</head>

<style>

#all {

margin:auto

width:500px

height:544px

}

</style>

<body>

<div id="all">

<video src="sp.mp4" controls poster="sl.jpg"></video>

</div>

</body>

</html>

原位置向下移动固定像素

style="margin-top:50px" 或者 style="padding-top:50px"

换位置移动,你就需要把加载视频的div整体移动到你需要的位置。