Css 保证金自动需要居中
这是我的代码,我试图把它集中在页面的中间。Css 保证金自动需要居中,css,alignment,margin,center,Css,Alignment,Margin,Center,这是我的代码,我试图把它集中在页面的中间。 <!DOCTYPE html> <html lang="en"> <head> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <title>cp</title> </head> <body> <div class="well"> <font
<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>cp</title>
</head>
<body>
<div class="well">
<font face="arial" size="5" color="#000000"><center><b>Control Panel</font></center>
</div>
</style>
<style type="text/css">
.span12{
background: lightblue;
color: while;
padding: 9px 0;
border-radius:5px;
text-align: center;
border: 1px #00BFFF solid;
margin: 0px auto;
width: 50%;
margin-top: 25%;
}
</style>
<div class="span12">
Welcome
</div>
<script src="js/bootstrap.js"></script>
内容提供商
控制面板
.span12{
背景:浅蓝色;
颜色:while;
填充:9px0;
边界半径:5px;
文本对齐:居中;
边框:1px#00bff实心;
保证金:0px自动;
宽度:50%;
利润率最高:25%;
}
欢迎
它的大小与网页,但我不能得到整个东西是在页面的中心。
我只想在页面中间的整个页面 < p>删除<代码>中心>代码>标签,并设置<代码>边缘顶部:25% < /代码>,它将解决您的问题。
<!DOCTYPE html>
<html lang="en">
<head>
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<title>cp</title>
</head>
<body>
<div class="well">
<font face="arial" size="5" color="#000000"><center><b>Control Panel</font></center>
</div>
</style>
<style type="text/css">
.span12{
background: lightblue;
color: while;
padding: 9px 0;
border-radius:5px;
text-align: center;
border: 1px #00BFFF solid;
margin: 0px auto;
width: 50%;
margin-top: 25%;
}
</style>
<div class="span12">
Welcome
</div>
<script src="js/bootstrap.js"></script>
CSS
.span12{
background: lightblue;
color: while;
padding: 9px 0;
border-radius:5px;
text-align: center;
border: 1px #00BFFF solid;
margin: 0px auto;
width: 50%;
margin-top:25%; /* new */
}
HTML
<div class="span12">
Welcome
</div>
欢迎
你想让它也垂直居中吗?那个未闭合的中心标签是干什么的?我移除了中心标签,并按照你说的做了,但现在它刚刚从页面上消失了。是的,这很完美,但我的不行that@user2139212您的web浏览器是什么?@user2139212删除此行,然后重试:
我知道,但我需要它我可以把它关掉吗