我有这个html:
<body>
<div id="maindiv" class="rounded">
something written
</div>
</body>
用这个CSS:
body {
background-image: url('stjohnhusimages/green gradient.png');
background-repeat: no-repeat;
width:1024px;
height:1375px;
background-size: cover;
text-align:center;
}
#maindiv {
width:900px;
height:1275px;
margin-left: auto;
margin-right: auto;
margin-top: 40px;
background-color:#404853;
}
但主 div 仍然向左对齐。想知道我做错了什么。
谢谢你的帮助!