- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我不明白为什么我的照片
没有显示。 photos
div 放在 echo 语句之外时显示良好,但在 echo 时它只是不呈现。我的 div 具有以下结构:
userposts_panel
photos_div
photos
这是包含所有 div 的代码(完整):
<div class="userposts_panel">
<div class="photos_div">
<table>
<tr>
<?php
// get pictures from DB
$get_user_pics = mysqli_query ($connect, "SELECT * FROM user_photos WHERE uploaded_by='$username'"); // maybe $user
$check_rows = mysqli_num_rows ($get_user_pics);
while ($row = mysqli_fetch_assoc($get_user_pics)){
$user_id = $row ['id'];
$photo_url = $row ['img_url'];
$phot_desc = $row ['photo_desc'];
$photo_uploaded_by = $row ['uploaded_by'];
$photo_uloaded_on= $row ['uploaded_on'];
$uid = $row ['uid'];
echo "<td>
<div class='photos'>
<img src='$photo_url' height='170px' width='170px'/>
</div>
</td>";
}
?>
</tr>
</table>
</div>
</div>
</div>
.userposts_panel CSS:
.userposts_panel{
margin:0 auto;
height: auto;
text-align:left;
position:absolute;
top: 395px;
left:10px;
width: 800px;
background-color:#ffffff;
border-bottom: 1px solid #E1E3E4;
border-left: 1px solid #E1E3E4;
border-right: 1px solid #E1E3E4;
z-index:999;
}
.photos_div CSS:
.photos_div{
background-color: #FFFFFF;
width: 800px;
height: 500px;
}
.photos CSS:
.photos{
position:absolute;
top:0;
left:0;
margin-top:11px;
margin-left:5px;
background-color: #ffffff;
border: 1px solid red;
padding: 3px;
width: 200px;
height:200px;
margin-right: 5px;
text-align:center;
}
我只是不明白为什么 div 在 echo 时没有出现,但在 echo 语句之外呈现得很好?任何帮助将不胜感激。
最佳答案
尝试在 echo 语句中连接变量 $photo_url
<div class="userposts_panel">
<div class="photos_div">
<table>
<tr>
<?php
// get pictures from DB
$get_user_pics = mysqli_query ($connect, "SELECT * FROM user_photos WHERE uploaded_by='$username'"); // maybe $user
$check_rows = mysqli_num_rows ($get_user_pics);
while ($row = mysqli_fetch_assoc($get_user_pics)){
$user_id = $row ['id'];
$photo_url = $row ['img_url'];
$phot_desc = $row ['photo_desc'];
$photo_uploaded_by = $row ['uploaded_by'];
$photo_uloaded_on= $row ['uploaded_on'];
$uid = $row ['uid'];
?>
<td>
<div class='photos'>
<img src='<?php echo $photo_url; ?>' height='170px' width='170px'/>
</div>
</td>
<?php
}
?>
</tr>
</table>
</div>
</div>
关于php - Div 没有出现在 PHP echo 语句中,但在 echo 语句之外呈现良好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35254765/
嗨,我正在考虑开发一种文件传输程序,想知道我是否想要尽可能好的加密,我应该使用什么? 我会用 C# 开发它,所以我可以访问 .net 库 :P在我的 usb 上有一个证书来访问服务器是没有问题的,如果
我创建的这个计算两个数组的交集是线性的方法的复杂度(在良好、平均、最差的情况下)? O(n) public void getInt(int[] a,int[] b){ int i=0; int
我已经能够使用 RTCPeerConnection.getStats() API 获得 WebRTC 音频调用的各种统计信息(抖动、RTT、丢包等)。 我需要将整体通话质量评为优秀、良好、一般或差。
基本问题: 如果我正在讲述/修改数据,我应该通过索引硬编码索引访问文件的元素,即 targetFile.getElement(5);通过硬编码标识符(内部翻译成索引),即 target.getElem
在 Linux 上,我想知道要调用什么“C”API 来获取每个 CPU 的统计信息。 我知道并且可以从我的应用程序中读取 /proc/loadavg,但这是系统范围的负载平均值,而不是每个 CPU 的
在客户端浏览器中使用 fetch api,GET 或 POST 没有问题,但 fetch 和 DELETE 有问题。它似乎将 DELETE 请求方法更改为 OPTIONS。 大多数研究表明是一个cor
我是一名优秀的程序员,十分优秀!