我正在为我的网站做一个新设计。我想我应该做不同的盒子。他们所有的borders
和backgrounds
必须相同,但他们的heights
和widths
必须不同。所以,我创建了一个 CSS 类。
.box
{
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwNWFmZiIgc3RvcC1vcGFjaXR5PSIwLjUiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzAwNWFmZiIgc3RvcC1vcGFjaXR5PSIwLjUiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==);
background: -moz-linear-gradient(left, rgba(0,90,255,0.5) 0%, rgba(0,90,255,0.5) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(0,90,255,0.5)), color-stop(100%,rgba(0,90,255,0.5)));
background: -webkit-linear-gradient(left, rgba(0,90,255,0.5) 0%,rgba(0,90,255,0.5) 100%);
background: -o-linear-gradient(left, rgba(0,90,255,0.5) 0%,rgba(0,90,255,0.5) 100%);
background: -ms-linear-gradient(left, rgba(0,90,255,0.5) 0%,rgba(0,90,255,0.5) 100%);
background: linear-gradient(to right, rgba(0,90,255,0.5) 0%,rgba(0,90,255,0.5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#80005aff', endColorstr='#80005aff',GradientType=1 );
border:thick white groove;
border-bottom-color:gray;
border-right-color:gray;
border-top-left-radius:1em;
border-bottom-right-radius:1em;
}
我将 HTML 代码作为 -
<body onload="load()">
<center>
<div style="width:1120px">
<img src="images/blu-logo.png" style="float:left;">
<div class="box" style="width:900px;height:50px;float:right;margin-top:100px;">
</div>
</div>
<div class="box" style="width:900px;height:500px;">
<p>Sample text</p>
</div>
</center>
</body>
我不知道如何,但是当我在浏览器中查看文件时发生了一些疯狂的事情
<div>
,因为应该在另一个之下的除法()实际上与第一个相同。