gpt4 book ai didi

html - div被放在上面的div中

转载 作者:太空宇宙 更新时间:2023-11-03 21:06:59 25 4
gpt4 key购买 nike

所以我想将两个 div 并排放置,代码中下面的那个被放到上面的那个里,我不知道为什么。

HTML:

<body>
<div id="links">
<h1 id="title">Webcam</h1>
<?php

$dateinamen = 'pictures/Live.jpg';
$timestamp = filemtime($dateinamen);
$time = time();
$diff = $time -$timestamp;

// Wenn Bild jünger als 10sec
if ($diff < 10){
echo "<img src='pictures/Live.jpg'";
}
else {
echo "<img src='pictures/oops.jpg'";
}
?>
</div>

<div id="rechts">
<h2>Ping</h2>
<?php

$host1="192.168.1.1";
exec("ping -c 1 -w 1 " . $host1, $output1, $result1);
if ($result1 == 0) {
echo "<h3 id='sw1'style='background-color: green';>Router</h3></br>";
}else {
echo "<h3 id='sw1'style='background-color: red';>Router</h3></br>";
}
?>
</div>
</body>

CSS:

#links{
float: left;
width: 50%;
}

#rechts{
float: right;
width: 50%;
margin-top: 7%;
}

没有发现这样的情况,所以不知道是xampp的问题还是其他的。

编辑 Photo in inspection mode in Google Chrome

最佳答案

您没有关闭 PHP 代码中使用的 img 标签。

use <img src='pictures/Live.jpg'>

关于html - div被放在上面的div中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51784353/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com