有誰知道如何使我的行和列的表移動響應。我從數據庫中插入數據,但它們不是移動響應。 element1和content1 id用於元素的背景。你能告訴我如何使我的行和列移動響應表?如何使我的行表響應
這是我的HTML和PHP:
<section>
<table>
<tr>
<?php
$counter = 0;
while($product = mysqli_fetch_assoc($featured)){
if($counter % 4 == 0){
echo '</tr><tr>';
}
++$counter;
?>
<td>
<div id="element1"></div>
<div id="content1">
<img src="<?= $product['image']; ?>" alt="<?= $product['title']; ?>">
<h4><?= $product['title']; ?></h4>
<hr>
<p class="description"><?= $product['description']; ?></p>
<!--------BUTTON READ MORE-------->
<div id="hovers">
<a href="<?php echo $product['href']?>" class="button" target="_blank">
<span class="contentbut"> Read More</span>
</a>
</div>
</td>
<?php
}
?>
</tr>
</div>
</table>
</section>
這裏是我的CSS:
#element1{
position: relative;
z-index:1;
width:320px;
height:380px;
text-align:left;
background: url('../interviewsbackground.png') no-repeat center;
border:#F90 2px solid;
}
#content1{
position:relative;
z-index:2;
top: -380px;
width:290px;
color:#FFF;
text-align:left;
margin:34px;
margin-bottom:-240px;
}
/*-------------------------3D BUTTONS-----------------*/
.button{
display:block;
width:120px;
height:45px;
position:relative;
border:2px solid #04a;
margin: 0px 0px;
border-radius:5px;
}
.button .contentbut{
display:block;
position:absolute;
bottom:6px;
width:100%;
height:100%;
line-height:50px;
background-color:#09f;
text-align:center;
color:#fff;
text-transform:uppercase;
box-shadow: 0 6px 0 #06c;
border-radius:5px;
transition:all 0.ls linear;
}
定義移動響應?佈局應該改變什麼? – dognose
我需要行以適應手機視圖。 – Kaloyan
嘗試構建一個不涉及PHP的示例。表格通常是自然界的反應 - (在某種程度上) - 因此,您可能是指圖像...... - 您無需在評論中回答 - 它們旨在幫助您清除問題 - 並且「適合移動視圖「不夠清晰,無法提供幫助。 – sheriffderek