2015-12-03 165 views
0

在我的网页设计课上为一个项目工作,无法弄清楚所有这些空白来自哪里。一切都需要互相触碰,但我认为我有些额外的填充物,但我似乎无法找到它。这是我所有的代码。另外,我想知道如何摆脱左侧<ul>中的子弹。我试过list-style-type:none,但这似乎没有做任何事情。这个白色空间来自哪里?

<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 

<title>SylviaGunter WEB-210 Project 6</title> 

<meta name="viewport" content="width=device-width"> 

<link href='https://fonts.googleapis.com/css?family=Peralta' rel='stylesheet' type='text/css'> 

<link href='https://fonts.googleapis.com/css?family=Gochi+Hand|Peralta' rel='stylesheet' type='text/css'> 

<link rel="stylesheet" 
      href=01%20-%20Large%20CSS.css> 
<link rel="stylesheet" type="text/css" href="02 - Medium CSS"> 
<link rel="stylesheet" type="text/css" href="03 - Small CSS"> 
<link rel="stylesheet" type="text/css" href="04 - Print CSS"> 
<link rel="stylesheet" type="text/css" href="05 - IE"> 

</head> 

    <body> 
     <div class="wrapper"> 
      <body> 
    <div class="banner"> 
     <h1>Best TV Ever</h1> 

     <div class="topnav"> 
      <ul> 
       <li><a href="#">50s</a></li> 
       <li><a href="#">60s</a></li> 
       <li><a href="#">70s</a></li> 
       <li><a href="#">80s</a></li> 
       <li><a href="#">90s</a></li> 
      </ul> 
     </div> 
    </div> 
</body> 





[insert menu toggle here] 
[insert menu checkbox here] 





<aside class="sidebar1"> 

    Best Prime Time Shows 
<ul> 
    <li><a href="#">Alice</a></li> 
    <li><a href="#">All In The Family</a></li> 
    <li><a href="#">Barney Miller</a></li> 
    <li><a href="#">Beverly Hillbillies</a></li> 
    <li><a href="#">Bewitched</a></li> 
    <li><a href="#">The Bob Newhart Show</a></li> 
    <li><a href="#">The Brady Bunch</a></li> 
    <li><a href="#">Gilligan's Island</a></li> 
    <li><a href="#">Good Times</a></li> 
    <li><a href="#">The Love Boat</a></li> 
    <li><a href="#">Mary Tyler Moore</a></li> 
    <li><a href="#">M*A*S*H</a></li> 
    <li><a href="#">Maude</a></li> 
    <li><a href="#">One Day At A Time</a></li> 
    <li><a href="#">Petticoat Junction</a></li> 
    <li><a href="#">Soap</a></li> 
    <li><a href="#">Taxi</a></li> 
    <li><a href="#">What's Happening</a></li> 
    <li><a href="#">Welcome Back Kotter</a></li> 
    <li><a href="#">WKRP In Cincinatti</a></li> 
</ul> 

      </aside> 


<article class="main"> 

<h2>The Genius of Krofft</h2> 

<h3>H.R. Pufnstuff</h3> 

<p> <img src="hrpufnstuff.jpg" alt="hrpufnstuff" height="150" width="200">H.R. Pufnstuf centered on a shipwrecked boy named Jimmy. He and his friend, a talking flute named Freddy, take a ride on a mysterious boat, which promised adventures across the sea, to Living Island. The Mayor of Living Island was a friendly and helpful dragon named H.R. Pufnstuf. The boat was actually owned and controlled by a wicked witch named Wilhelmina W. Witchiepoo who rode on a broomstick-like vehicle called the Vroom Broom. She used the boat to lure Jimmy and Freddy to her castle on Living Island, where she was going to take Jimmy prisoner and steal Freddy. But Pufnstuf found out about her plot and was able to rescue Jimmy when he leaped out of the enchanted boat with Freddy and swam ashore.</p> 

<h3>Lidsville</h3> 


<p><img src="lidsville.jpg" alt="lidsville" height="150" width="200"> 
The show involved a teenage boy named Mark who fell into the hat of Merlo the Magician and arrived in Lidsville, a land of living hats. The hats on the show are depicted as having the same characteristics as the humans who would normally wear them.</p> 

<h3>The Bugaloos</h3> 


<p><img src="bugaloos.jpg" alt="bugaloos" height="150" width="200">The Bugaloos featured a musical group composed of four British-accented teenagers, who lived in fictional Tranquility Forest. They wore insect-themed outfits with antennae and wings which allowed them to fly. They were constantly beset by the evil machinations of Benita Bizarre, played by comedienne Martha Raye.</p> 

<h3>Land of the Lost</h3> 


<p><img src="landlost.jpg" alt="landlost" height="150" width="200">Land of the Lost details the adventures of the Marshall family (father Rick and his teenage children Will and Holly) who are trapped in an alternate universe inhabited by dinosaurs, a primate-type people called Pakuni, and aggressive humanoid/lizard creatures called Sleestak.</p> 

<h3>Sigmund the Sea Monster</h3> 


<p><img src="sigmund.jpg" alt="sigmund" height="150" width="200">The show centered on two brothers, Johnny and Scott Stuart, who discover Sigmund, a friendly young sea monster who had been thrown out by his comically dysfunctional undersea family for refusing to frighten people. The boys hide Sigmund in their clubhouse.</p> 

      </article> 



    <aside class="sidebar2"> 
    Best Superhero Shows 
<ul> 
    <li><a href="#">Batman (1966)</a></li> 
    <li><a href="#">The Bionic Woman (1976)</a></li> 
    <li><a href="#">Electra Woman and Dyna Girl (1976)</a></li> 
    <li><a href="#">The Greatest American Hero (1981)</a></li> 
    <li><a href="#">The Incredible Hulk (1977)</a></li> 
    <li><a href="#">Isis (1975)</a></li> 
    <li><a href="#">Shazam! (1974)</a></li> 
    <li><a href="#">The Six Million Dollar Man (1974)</a></li> 
    <li><a href="#">Wonder Woman (1976)</a></li> 
</ul> 
      </aside> 




<div id="footer"> 
Stop watching TV and write some code! 
      </div> 



</body> 
</html> 

body{ 

} 


.banner h1{ 
    background-color: black; 
    background-image: url(logo.png); 
    background-repeat: no-repeat; 
    font-family: Peralta; 
    color: white; 
    height: 100px; 
    padding-top: 25px; 
    padding-left: 150px;} 

h2{ 
    font-family: Peralta; 
    text-align: center; 
    height: 25px; 
    background-color: white; 
    padding-top: 0; 
    height: 50px; 
} 

p{ 
    border-bottom: 1px solid black; 
    padding-bottom: 3em; 
    display: block; 
    overflow: hidden; 
    height:130px; 
} 

img{ 
    float: left; 

    margin-right: 1em; 
    width: 150px; 
    height: 100px; 
    padding-left: 10px; 
    border-radius: 20px;} 



.topnav ul li { 
    display: inline-block; 
float: right; 
    position: relative; 
    top: -120px; 
} 


.topnav ul li a:link{ 
    text-decoration: none; 
    color: black; 
background-color: white; 
border-radius: 50%; 
margin: 10px; 
width: 100px; 
    font-size: 20px} 

*{ 
    -moz-box-sizing:border-box; 
    box-sizing: border-box; 
} 

.sidebar1{ 
    float: left; 
    width: 265px; 
    padding: 0 20px 0 20px; 
    background: url(sidebar1background.jpg); 
    background-repeat: repeat-y; 
    height: 1000px; 

} 

.main{ 

    float: left; 
    width: 60%; 
    padding: 0 20px 0 20px; 
    background-color: #d4ff80; 
    height: 1000px; 

} 

.sidebar2{ 
    float: right; 
    width: 265px; 
    padding-right: 30px; 
    padding: 0 10px 0 20px; 
    background: url(sidebar2background.jpg)right top; 
    background-repeat: repeat-y; 
    height: 1000px; 
    list-style-type: none; 


} 

.sidebar1 a:link{ 
    background-color: #c1c1a4; 
    border-radius: 20px; 
    border:1px solid white; 
    display: block; 
    background-size: 15px; 
    text-decoration: none; 
    width: 200px; 
    padding: 5px 5px 5px 35px; 
    margin-bottom: 10px; 
    color: darkgreen; 
    padding-right: 20px; 
} 



#footer{ 
    clear: both; 
    height: 50px; 
    padding-top: 15px; 
    background-color: black; 
    color: white; 
    text-align: center; 
} 
+4

一文件不能有两个'body'标签 –

+1

修复后,请创建一个[mcve] _online_某处(jsfiddle,codepen,...) – CBroe

+0

URL中的空格是你应该避免的东西。 – CBroe

回答

0

浏览器都内置样式增加了一些空间(补白&边距)默认情况下,这是跨浏览器不同。 你需要做一个reset css

* { 
    padding: 0; 
    margin: 0; 
} 

关于你的子弹,你需要指定两个列表:

.sidebar1 ul, .sidebar2 ul { 
    list-style-type: none; 
} 
/* OR */ 
aside ul { 
    list-style-type: none; 
} 
+0

太棒了!子弹消失了。但是,中心内容和右侧边栏之间仍然有大约一英寸的空白。当我添加重置CSS代码时发生的唯一事情是它将内部ul一直移动到侧栏背景的左边缘。我需要关闭这个空间。不知道如何做到这一点。 – Sylvia585

+1

您正在设置:'20px'宽填充到'.main'。此外,您正在混合固定宽度百分比,这将使其仅在小范围的分辨率宽度下工作。 –

0

要解决边栏项目列表使用:

.sidebar1 ul{ 
    list-style-type:none; 
}