绝对定位。需要帮助显示 3 张图像而不是 1 张
</div>
<div style="position:absolute;top:160px;left:535px;"><img src="splash.png"></div>
<div style="position:absolute;top:160px;left:535px;"><img src="splash2.png"></div>
<div style="position:absolute;top:160px;left:535px;"><img src="splash3.png"></div>
<!-- Press Logos -->
<div align="center">
我怎样才能让所有三个启动图像水平显示......
</div>
<div style="position:absolute;top:160px;left:535px;"><img src="splash.png"></div>
<div style="position:absolute;top:160px;left:535px;"><img src="splash2.png"></div>
<div style="position:absolute;top:160px;left:535px;"><img src="splash3.png"></div>
<!-- Press Logos -->
<div align="center">
how can i get all three splash images to display horizontally...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
“水平显示”是指它们彼此相邻地排在一条线上吗?标记中的图像会自然地执行此操作,除非没有足够的空间,在这种情况下,它们会环绕到下面的空间。
您可以将样式应用于周围的 div 以将图像居中放置等。
此外,您的原始标记示例有一些错误的标记。您的图像标签应该是自动关闭的(即以 /> 结尾,而不是 >)。
By 'Display horizontally', do you mean they sit next to each other on one line? Images in markup will do this naturally unless there is not enough room, in which case they wrap to space below.
You can apply styling to the surrounding div to position the images centered, etc.
Additionally, your original markup example has some bad markup. Your image tags should be self-closing (I.e. ending in />, not >).
你可以
给每个div一个不同的x位置(实际上是最直接的方法)
将它们放入足够宽度的容器中并给容器
position:absolute
而不是周围的divYou could
Give each div a different x position (the most straightforward way, really)
Put them into a container of sufficient width and give the container
position: absolute
instead of the surrounding divs尝试将您的代码更改为:
Try changing your code to look like:
您还可以使用浮动:
You can also use floats: