我有兩個圖像在左邊緣和右邊緣之一。我想把兩個元素集中起來,讓他們在中間相遇。如何在已經漂浮的情況下使用填充權?
但是因爲我右邊的那個盒子是右對齊到左邊的,所以我的填充右邊不能用來推動它。
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