<分区>
<分区>
我是设计和布局的新手,我得到了这个线框:
http://problemio.com/problemionewest.pdf
而且我必须让灰色边框延伸整个宽度,并且 Logo 要垂直居中。
现在我有这个哈哈:http://www.problemio.com - 横幅一直延伸,但由于重复,右侧有一条丑陋的垂直线。而且,我不确定如何使 Logo 图像居中。原始图像有点大,所以我需要将其调整为原始图像的一定百分比并垂直居中对齐。
有什么办法可以做到这些吗?
谢谢!
最佳答案
您需要执行以下操作:
在.banner
上设置一个新的height
我选择70px
给.banner
一个background-size:100%
从 .site_title
中移除 vertical-align
并添加 margin-top: -15px;
CSS
.banner {
position: relative;
height: 70px;
z-index: 1;
border-style: solid;
border-width: 1px;
border-color: gray;
background-image:url('http://www.problemio.com/img/ui/banner_background.png');
background-size: 100%;
}
.site_title {
float: left;
margin-top: -15px;
margin-left: 20px;
width: 300px;
}
关于html - 如何让banner图片全长延伸,logo居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7810125/