我正在学习HTML,而且我已经制作了一个我需要帮助的程序。我写了所有代码,但我希望图片BOB 1/2/3彼此相邻。此外,我不知道为什么我无法看到" Home"。还希望页面底部的信息应该彼此相邻
提前致谢:)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>My first website</title>
<meta name="viewport" content="width=divice-width, initial-scale=1.0">
<style>
body{
background: #00FF33;
font-family: Verdana, Tahama, Arial, sans-serif;
font-size: 18px;
overflow: auto;
}
h1, h2, h3 {
text-align: center;
padding-left: 5%;
color: #000066;
}
p {
padding: 2%
color: #000066;
}
img {
text-align: center;
max-width: 100%;
height: auto;
width: auto;
}
#wrapper {
margin: 0 auto;
max-width: 1020px;
width: 98%
background: #000000;
border: 1px solid #878E63;
border-radius: 2px;
box-shadow: 0 0 10px 0px rgba(12, 3 , 25, 0.8);
}
#callout {
width: 100%;
height: auto;
background: #000000;
overflow: hidden;
}
#callout p{
text-align: right;
font-size: 13px;
padding: 0.1% 5% 0 0;
color: #FFFF00;
}
#callout p a{
color: #CC0000;
text-decoration: none;
}
header {
width: 96%;
min-height: 125px;
padding: 5px;
text-align: center;
}
nav ul {
list-style: none;
margin: 0;
padding-left: 50px;
}
nav ul li {
float: left;
border: 1px solid #878E63;
width: 15%;
}
nav ul li a {
background: #F1F0D1;
display: black;
padding: 5% 12%
font-weight: bold;
font-size: 18px;
color: #878E63;
text-decoration:none;
text-align: center;
}
nav ul li:hover, nav ul li.active a {
background-color: #878E63;
color: #878E63;
}
.banner img {
width: 100%;
border-top: 1px solid: #878E63;
border-bottom: 1px solid: #878E63;
}
.clearfix {
clear: both;
}
.BobContainer{
width: 29%;
display: inline-block;
text-align: center;
margin: 0 1.666%;
}
.left-col {
width: 55%;
margin: -2% 1% 1%;
float: left;
}
.sidebar {
width: 40%;
float: right;
margin: 1%;
text-align: center;
}
.hallo{
float: left;
margin: 0 auto;
width: 100%;
height: auto;
padding: 1%;
}
.section{
width: 29%;
margin: 2% 2%;
display: inline-block;
text-align: center;
}
footer{
background: #878E63;
width: 100%;
overflow: hidden;
}
footer p, footer h3{
color: #F1F0D1;
}
footer p a{
color: #F1F0D1;
text-decoration: none;
}
ul{
list-style-type: none;
margin: 0;
padding: 0;
}
li {
display: inline;
}
ul li img{
height: 50%;
}
.footerLogos{
width: 45%;
margin: 0 2.45%;
display: inline-block;
text-align: center;
}
/*---------MEDIA---------*/
@media screen and (max-width: 478px){
body{
font-size: 13px;
}
}
@media screen and (max-width: 740px){
nav{
width: 100%;
margin-bottom: 10px;
}
nav ul{
list-style: none;
margin: 0 auto;
padding-left: 0;
}
nav ul li{
text-align: center;
margin-left: 0 auto;
width: 100%;
border-top: 1px solid #878E63;
border-left: 0px solid #878E63;
border-bottom: 1px solid #878E63;
border-right: 0px solid #878E63;
}
nav ul li a{
padding: 8px 0;
font-size: 16px;
}
.left-col {
width: 100%;
}
.sidebar{
width: 100%;
}
.section{
float: left;
width: 100%;
margin: 0;
}
}
</style>
</head>
<body>
<div id="wrapper">
<div id="callout">
<p>Call us at <b>123456</b></p>
</div>
<header>
<a href="#"><img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
</header>
<nav>
<ul>
<li class='active'><a href="#">Home</a></li>
<li><a href="#">Prices</a></li>
<li><a href="#">Who are we?</a></li>
</ul>
</nav>
<div class="banner">
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
</div>
<section class="left-col">
<p style ="text-indent: 50px;">Restaurant websites are a great place to find inspiring designs and also to check out some nice ways of displaying photographs within a design. Since the main content of a restaurant is their food – or at least it should be – there is no better thing to do than show beautiful images of the food</p>
<p style ="text-indent: 50px;">HELLOZZ</p>
</section>
<aside class="sidebar">
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<div class="hallo">
</div>
</aside>
<div class="BobContainer">
<h3>BOB1</h3>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<p>Du</p>
</div>
<div class="BobContainer">
<h3>BOB2</h3>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<p>Er</p>
</div>
<div class="BobContainer">
<h3>BOB3</h3>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<p>Dum</p>
</div>
<footer>
<div class="footerLogos"
<p>Call us at:</p>
<p><b>123456</b><br>
Or write to<br>
www@hotmail.com<br>
2670 Greve</p>
</div>
<div class="footerLogos"
<ul>
<li><a href="#"><img src="http://www.adweek.com/socialtimes/wp-content/uploads/sites/2/2013/04/2-150x150.png"</a></li>
<li><a href="#"><img src="http://virtualmarketingpro.com/blog/empreendeglobal/wp-content/uploads/sites/897/2015/01/logo-youtube-335x320.png"</a></li>
</ul>
<div class="footerLogos"
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
</div>
</footer>
</div>
<p style="text-align: center; padding:0px;">©Copyright - hala hala, 2015</p>
</body>
</html>
&#13;
答案 0 :(得分:1)
在CSS代码中尝试添加到部分样式:display: inline-block;
同时删除:float : left;