有谁知道如何使我的行和列的表移动响应。我从数据库中插入数据,但它们不是移动响应。 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