我有两个图像在左边缘和右边缘之一。我想把两个元素集中起来,让他们在中间相遇。如何在已经漂浮的情况下使用填充权?
但是因为我右边的那个盒子是右对齐到左边的,所以我的填充右边不能用来推动它。
I want to center these two things
这里是我的代码:
<section id="content1">
<a href="#"><img src="images/matcha.jpg" alt="pic1" width="300" height="300" /></a>
<div class="box1">
<div class="heading1">
<p>GREEN TEA LOVE</p>
</div>
<div class="paragraph1">
<p>Top Impression Bakery Cafe has been on my go-to list for awhile since I saw their
Green Tea Croissant on Instagram. If you know me well you would know that I'm a huge
fan of anything Matcha and if anything is Matcha related I've got to try it!</p>
</div>
</div>
</section>
CSS:
#content1{
padding-top:50px;
padding-bottom:30px;
width: 960px;
}
.box1{
width:500px;
height:300px;
background:-moz-linear-gradient(top, #77ebcf 20%, #ffffff 20%);
border-style:solid;
float:right;
}
我只看到一个图像和''标签不应该有一个结束斜杠。 – Rob