我想尝试旁边的一些文字的图像。我希望它与文本垂直居中,但向左偏移,因此它不与文本重叠。我可以做到这一点,但每当我调整我的浏览器的大小,使其更小,图像不会移动。图片将不会调整大小与浏览器大小
我试图把文本放在文本中,但每当我这样做的文本不正确居中。我还必须在图像下添加一个链接,所以我不认为这是最好的方法。
这里是我的代码的问题的JSBin:http://jsbin.com/evasix/2/ **我在jsbing中包含了我的完整代码,因为我认为某些东西可能会被另一个div类继承。
HTML:
<div class="middle">
<div class="side-img">
<h2>Millions of entrepreneurs, freelancers, small<br>businesses, and departments inside big<br> organizations rely on our web apps.</h2>
<img src="images/img-customerss.png" class="customers">
</div>
</div>
CSS:
h2 {
position: relative;
top: -30px;
text-align: center;
font-size: 45px;
color: #232323;
font-family: 'Crimson Text', serif;
line-height: 50px;
}
.customers {
position: relative;
bottom: 150px;
left: 425px;
}
我看不出有任何的代码(CSS而不是HTML),任何尺寸的图像。你为什么认为它应该? – GolezTrol
我无法查看重新链接,但是您是否尝试过使用百分比而不是固定像素大小? Firebug帮助很多这种类型的东西 – null
我不知道为什么链接不工作,它似乎工作正常。不,我没有为图片添加大小,因为图片的大小是我想要的。我还没有弄清百分比,你的意思是把底部/顶部PX值改成百分比? – HelloWorld