gpt4 book ai didi

css - 图像和分隔符定位

转载 作者:太空宇宙 更新时间:2023-11-04 03:38:24 26 4
gpt4 key购买 nike

我的天气网络应用程序有问题。

正如您在下面的屏幕截图中看到的,如果设备的宽度较低,预测会正确显示,但如果您在台式机或 iPad 上浏览页面,图像不会留在左侧.

高宽度屏幕

enter image description here

小宽度屏幕

enter image description here

这是一天的代码:

echo '<div class="line-separator"></div>';
echo '<img class="small_img_meteo" src="images/' .$img1 . '.png"/>';
echo '<p>'.$name1.'<br />' .$condizione_txt1. '</p>';
echo '&nbsp';

这是样式表

.small_img_meteo{
position:relative;
float:left;
width:20%;
}

.line-separator{

height:1px;

background:#FFFFFF;

border-bottom:1px solid #717171;

}

不幸的是,我不能为字体使用 vw 大小

那么,有没有办法将行分隔符放在图像的末尾(因为它们实际上覆盖了图像,它们只关心文本的末尾),或者将图像固定到左

最佳答案

问题是您的图像 float 。添加一个 clear: both;.line-separator

关于css - 图像和分隔符定位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25243134/

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