gpt4 book ai didi

html - 我正在尝试使用 CSS 水平显示图像

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

我有一系列图像,我想使用 CSS 和 div 在我的网站上水平显示。我已经看过几篇关于如何水平显示图像的文章,但我无法让其中任何一篇文章发挥作用。

这是我所指页面的代码:

 <head>
<link rel=StyleSheet href="style.css" type="text/css" media=screen>
<style>
div.imageBox {
float: left;
margin-right: 10px;
}

div.imageBox p {
text-align: center;
}

</style>
</head>
<body>
<?php include 'header.php'; ?>
<div id="content">
<div id="container">

<div class="imageBox">
<img src="image" width="800" height ="600">
</div>

<div class="imageBox">
<img src="image" width="600" height ="450">
</div>

<div class="imageBox">
<img src="image" width="800" height ="450">
</div>

</div>
</div>
</body>

这是样式表的代码:

body{
font-family: helvetica, arial, sans-serfif;
font-size: 14px;}

div#menu {
display: inline;
text-align: center;
width: auto;
top: 20px;
margin-left: 10%;
margin-right: 10%;
background: transparent;
height: 10px;
position: fixed;
}


div#menu ul {
margin: 0;
display: block;
}

div#menu ul li {
padding-right: 55px;
display: inline;
}

div#content {
padding-top: 40px;
text-align: center;
}

div#container{
float: left;
display: inline;
height: 800px;
width: 0px;
}

a:link {
text-decoration: none;
color: #000;
}
a:active {
text-decoration: none;
color: #000;
}
a:visited {
text-decoration: none;
color: #000;
}
a:hover {
text-decoration: underline;
color: #000;
}

是否有更简单的方法让我做到这一点?

感谢您的帮助!

最佳答案

努力改变

div#container{
float: left;
display: inline;
height: 800px;
width: 0px;
}

进入

div#container{
float: left;
display: inline;
height: 800px;
white-space: nowrap;
}

关于html - 我正在尝试使用 CSS 水平显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6832428/

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