因此,在此頁面上,我想將文本放在圖像旁邊,而不是放在下面。製作兩個div並排顯示
http://www.helensheardfloraldesigns.co.uk/testimonials/
這是我目前的CSS:
<?php
// check if the repeater field has rows of data
if(have_rows('testimonial')):
// loop through the rows of data
while (have_rows('testimonial')) : the_row(); ?>
<div style="float:left; width:20%; background:#EEE; margin:1em;">
<img class="testimonial-image" style="width:100%;;" src="<?php echo get_sub_field('image'); ?>" />
</div>
<div style="float:left; width:77%;">
<p><?php echo get_sub_field('text'); ?></p>
</div>
<?php endwhile;
else :
// no rows found
endif;
?>
我將如何設置樣式使文本出現在圖片的右側並沒有下文?
1.不要混合使用'%'和'em'(你知道在某些時候會打破你?)。 2.不要使用內聯樣式(這是維護的噩夢)。 –