嗨,我正在建立手机网站,
但我有一个问题
我想在框CSS之间添加空间
这是截图
这是我的代码
<?php
include "connection.php";
?>
<ul data-role="listview" data-icon="false" data-divider-theme="a">
<li data-role="list-divider"><center><font color="white"><b>Sekolah Rekomendasi</b></font></center></li>
<div id="owl-demo-5">
<?php
$dataskl = mysqli_query($con,"SELECT alamat,diskon,link,logo,kode,nama_sekolah,vvip from sekolah where vvip='Ya' order by id_sekolah desc limit 0,10");
while ($skl = mysqli_fetch_object($dataskl))
{
$jd = $skl->link;
?>
<div style="border-style:solid;border-width:2px;width:162px;" class='product_item'>
<div>
<a data-ajax="false" href='<?php echo $jd ?>'>
<img style="float:left; margin-right:8px;width:70px;height:85px;" src='images/sekolah/logo/<?php echo $skl->logo ?>' class='c_image_1' alt=''>
</a>
<?php if ($skl->diskon=="Ya") { ?>
<div class='ribbon'><img src='images/biaya.png' alt=''></div>
<?php } else { } ?>
</div>
<?php
$ptng_nama = substr($skl->nama_sekolah,0,15);
$ptng_alamat = substr($skl->alamat,0,34);
?>
<div class='product_info'>
<a style="text-decoration:none" data-ajax="false" href='<?php echo $jd ?>'><font size="1"><?php echo $ptng_nama ?></font></a><br/>
<font size="1"><?php echo $ptng_alamat ?></font><br/>
<?php
$datac_pre = mysql_query("select count(id_kunjungan) as hitung from sekolah_kunjungan where kode='$skl->kode' and tgl_kunjungan between '$web->range_awal' and '$web->range_akhir'");
$cpre = mysql_fetch_object($datac_pre); ?>
<font size='1' color='blue'>Dilihat : <?php echo $cpre->hitung ?></font>
</div>
</div>
<?php } ?>
</div>
</ul>
如何在框之间添加空间?
helpme谢谢的
最佳答案
您可以在css规则中为这些块使用margin
或padding
属性。
CSS:
body, html {
margin:0;
padding:0;
}
div {
width:100px;
display:inline-block;
border:1px solid black;
height:300px;
}
.a {
margin-right:20px;
}
HTML:
<div class="a"></div><div class="b"></div>