Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 图像位于div下方,但不与之对齐_Css - Fatal编程技术网

Css 图像位于div下方,但不与之对齐

Css 图像位于div下方,但不与之对齐,css,Css,你好, 我试图编码一个设计,但我不能得到它正确对齐,无论我尝试它不会停留在同一个地方很好 这是它的样子 这就是它的本意 这是我的代码,希望可以修复 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"&

你好,

我试图编码一个设计,但我不能得到它正确对齐,无论我尝试它不会停留在同一个地方很好

这是它的样子

这就是它的本意

这是我的代码,希望可以修复

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>a</title>
<link rel="stylesheet" type="text/css" href="style/css/reset.css"/>
<style>
body {
color:#ffffff;
background:#1f1f1f url(style/images/background.png) repeat-x center top;
}

.profileMidSection {
height:239px;
width:860px;
color:#ffffff;
background:#2e2e2e;
clear:both;
}

ul.profileMidSection {
list-style:none;
vertical-align:middle;
line-height:47px;
}

ul.profileMidSection li {
height:47px;
vertical-align:middle;
clear:both;
}

ul.profileMidSection li a{
height:47px;
width:175px;
background:#333333;
text-decoration:none;
color:#737373;
float:left;
text-align:left;
padding-left:25px;
font-family: 'Open Sans', sans-serif;
font-weight:600;
font-size:10.5pt;
margin-left:-40px;
}

ul.profileMidSection li a:hover{
color:#ffffff;
border-left:3px solid #83bdf2;
width:172px;
}

.profileCaption {
background:#3c3c3c;
width:200px;
height:35px;
font-family: 'Open Sans', sans-serif;
font-weight:600;
font-size:11pt;
color:#ffffff;
border-radius:0 0 4px 4px;
-webkit-border-radius:0 0 4px 4px;
}
</style>
</head>

<body>
    <div class="profileMidSection">

        <ul class="profileMidSection">
            <li><a href="#">Recommended Games</a></li>
            <li style="margin-top:1px;"><a href="#">Your Friends Played</a></li>
            <li style="margin-top:1px;"><a href="#">You Liked</a></li>
            <li style="margin-top:1px;"><a href="#">Your Friends Liked</a></li>
            <li style="margin-top:1px;"><a href="#">Disliked</a></li>
        </ul>

          <img src="games/images/caption1.png" />
          <div class="profileCaption">Angry Birds&trade;</div>
          <img src="games/images/caption2.png" />
          <div class="profileCaption">Mario Kart Pro&trade;</div>    
          <img src="games/images/caption3.png" />
          <div class="profileCaption">Lazy&trade;</div>    
    </div>
</body>
</html>

A.
身体{
颜色:#ffffff;
背景:#1f url(style/images/background.png)repeat-x中心顶部;
}
.中腹部{
高度:239px;
宽度:860px;
颜色:#ffffff;
背景:#2e;
明确:两者皆有;
}
中腹部{
列表样式:无;
垂直对齐:中间对齐;
线高:47px;
}
ul.profileli{
高度:47px;
垂直对齐:中间对齐;
明确:两者皆有;
}
ul.profiles中段李a{
高度:47px;
宽度:175px;
背景:#333333;
文字装饰:无;
颜色:#7373;
浮动:左;
文本对齐:左对齐;
左侧填充:25px;
字体系列:“开放式Sans”,无衬线;
字号:600;
字号:10.5pt;
左边距:-40px;
}
ul.profiles中剖面li a:悬停{
颜色:#ffffff;
左边框:3px实心#83bdf2;
宽度:172px;
}
.简介标题{
背景:#3c;
宽度:200px;
高度:35px;
字体系列:“开放式Sans”,无衬线;
字号:600;
字号:11pt;
颜色:#ffffff;
边界半径:0 0 4px 4px;
-webkit边界半径:0 0 4px 4px;
}
愤怒的小鸟与贸易; 马里奥卡丁车专业与贸易; 懒惰与贸易;
使用类
game thumb
将每个图像和标题包装在
div
中,并将类向左浮动。然后,将所有游戏放入另一个
div
容器中,并在其上设置
overflow:hidden

感谢这让我更近了一步,现在只是所有图像都在一行上对齐,菜单栏在上一行。将菜单向左浮动,并在游戏库中添加一个边距,以抵消菜单的宽度。