2015-04-22 30 views
0

在我的CSS中,我的內容下面是我的頁面底部的大空白空間。據我所知,沒有任何內容足夠高到可以走下去。它不會發生在我正在製作的網站上的任何其他頁面上。爲什麼我的HTML頁面的底部在我的內容下面有很大的空間?

HTML

<body> 
<div id="wrapper"> 

    <div id="header"> 
     <a href="index.html"><div id="leftHeader"> 
     <img src="assets/logo2.jpg" alt="Logo" style="width:65px;height:65px"> 
     <h1>Amanda Farrington</h1> 
    </div> 
     <div id="nav"> 

     <ul> 
     <li><a href="about.html">About</a></li> 
     <li><a href="#workJump">Work</a></li> 
     <li><a href="contact.html">Contact</a></li> 
     <li><a href="notes.html">Notes</a></li> 
     </ul> 
     </div> 
    </div> 



    <div id="hero"> 
     <div id="heroImage"> 
     <img src="assets/trees.jpg" alt="trees" style="width:100%;height:10%"> 
     </div> 

     <div id="overlay"> 
     <h2>Amanda Farrington</h2> 
     <h3>Graphic Artist | Web Designer</h3> 
    <a href="assets/resume.pdf" class="down">View Resume</a>     


     </div> 
    </div> 


<a name="workJump"></a> 

    <div id="work"> 
     <div id="label"> 
     <h4>Work</h4> 
     </div> 
    <div id="leftColumn"> 

     <div id= "p2article"> 
     <a href="work1.html"> 
     <img src="assets/work1p.jpg" alt="work one" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">Cut Paper Portrait</span> 
     </div> 
     </div> 
     </div> 

     <div id= "p2article"> 
     <a href="work3.html"> 
     <img src="assets/work3p.jpg" alt="Work 3" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">3D Christmas Eve Scene</span> 
     </div> 
     </div> 
     </div> 

     <div id= "p2article"> 
     <a href="work5.html"> 
     <img src="assets/work5p.jpg" alt="work 5" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">3D Clock Ad</span> 
     </div> 
     </div> 
     </div> 

       <div id= "p2article"> 
      <a href="work7.html"> 
     <img src="assets/work7p.jpg" alt="work 7" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">RIT Event Calendar Redesign</span> 
     </div> 
     </div> 
     </div> 

    </div> 

    <div id="rightColumn"> 
     <div id= "p2article2"> 
     <a href="work2.html"> 
     <img src="assets/work2p.jpg" alt="work two" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">Charcoal Self-Portrait</span> 
     </div> 
     </div> 
     </div> 

     <div id= "p2article2"> 
     <a href="work4.html"> 
     <img src="assets/work4p.jpg" alt="Work 4" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">VH1 3D Bumper Animation</span> 
     </div> 
     </div> 
     </div> 

       <div id= "p2article2"> 
       <a href="work6.html"> 
     <img src="assets/work6p.jpg" alt="work 6" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">Beauty Is</span> 
     </div> 
     </div> 
     </div> 

       <div id= "p2article2"> 
       <a href="work8.html"> 
     <img src="assets/work8p.jpg" alt="work 8" style="width:100%;height:100%"> 
     <div id= "articleinfo2"> 
     <div id= "articleText2"> 
     <span class="title3">Reporter Site Redesign</span> 
     </div> 
     </div> 
     </div> 
    </div> 




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

CSS

body { 
    margin: 0px; 
    padding: 0px; 
    background: white; 

} 

/*----------header styles-------------*/ 
#header { 
    color: #D7DADB; 
    font-family: 'Roboto', sans-serif; 
    font-weight: 300; 
    font-size : 15px; 
    text-align: left; 
    width: 100%; 
    padding-left: 3em; 
    position: relative; 
    height: 15%; 
    box-sizing: border-box; 
    padding-top: 1em; 

} 
h1:hover 
{ 
color: #2C3E50; 
} 


#header img 
{ 
    float: left; 
    padding-left: 3em; 
} 

h1{ 
width: 9em; 
float: left; 
padding-left: 0.5em; 
color: #45CCCC; 
padding-bottom: 1px; 
} 

#nav { 
    width: 50%; 
    margin:0; 
    padding:0; 
    text-align: right; 
    color: red; 
    font-size:20px; 
    float: right; 
    padding-right: 2em; 
    z-index: 98; 
    position: relative; 

} 

#nav ul { 
    padding: 1px; 
} 

#nav li { 
    display: inline; 
    padding: 38px; 
} 

#nav li a { 
    color: #2C3E50; 
    text-decoration: none; 
} 

#nav li a:hover { 
    color: #45CCCC; 
} 

/*----------hero image styles-------------*/ 
#hero{ 
    padding-top: 25em; 
    width: 100%; 
    height: 30em; 
    position: relative; 
    z-index: 0; 
} 

#heroImage 
{ 
    top: 9%; 
    width: 100%; 
    z-index: 1; 
    position: absolute; 

} 

#overlay{ 
    width: 34em; 
    top: -15%; 
    margin-left: 30%; 
    z-index: 2; 
    position: relative; 
    clear: left; 


} 

h2{ 
    width: 100%; 
    position: relative; 
    font-family: 'Roboto', sans-serif; 
    font-weight: 300; 
    font-size: 60px; 
    float: center; 
    color: white; 
    opacity: 1.0; 
    text-shadow: 2px 2px 3px #000000; 
    text-align: center; 
} 

h3{ 
    width: 100%; 
    position: relative; 
    font-family: 'Roboto', sans-serif; 
    font-weight: 300; 
    font-size: 30px; 
    color: #e5e5e5; 
    opacity: 1.0; 
    text-shadow: 2px 3px 2px #000000; 
    text-align: center; 

} 

a.down{ 
    z-index: 99; 
    font-family: 'Roboto', sans-serif; 
    font-weight: 400; 
    text-decoration: none; 
    color: #181b1e; 
    background: #45CCCC; 
    position: relative; 
    padding: 0.6em 0.2em; 
    font-size: 1.2em; 
    -webkit-border-radius: 6px; 
    width: 30%; 
    position: relative; 
    display: block; 
    margin-left: auto; 
    margin-right: auto; 
    text-align: center; 

} 

a.down:hover{ 
    text-decoration: underline; 
    color: white; 

} 

/*----------work main styles-------------*/ 
#leftColumn 
{ 
    width: 50%; 
    float: left; 
    height: 80em; 

} 

#rightColumn 
{ 
    width: 50%; 
    height: 80em; 
    float: right; 
} 

#label{ 
    width: 100%; 
    height: 2em; 
    top: 10em; 
} 

#work{ 
    width: 100%; 
    height: 10em; 
    position: relative; 
    top: -11em; 
} 

h4{ 
    width: 100%; 
    position: relative; 
    font-family: 'Roboto', sans-serif; 
    font-weight: 300; 
    font-size: 40px; 
    color: #45CCCC; 
    opacity: 1.0; 
    text-align: center; 
} 


#p2article2 
{ 
    width: 70%; 
    height:20em; 
    float: center; 
    display: block; 
    margin-left: auto; 
    margin-left: 60px; 
    margin-bottom: 10em; 
    margin-top: 5em; 
    border: 1px solid #cccccc; 
} 
#p2article2 img 
{ 
    border: 1px solid #cccccc; 

} 
a{ 
    text-decoration: none; 
} 

a:hover{ 
    text-decoration: underline; 
    color: #45CCCC; 
} 

#p2article 
{ 
    width: 70%; 
    height:20em; 
    float: center; 
    display: block; 
    margin-left: auto; 
    margin-right: 60px; 
    margin-bottom: 10em; 
    margin-top: 5em; 
    border: 1px solid #cccccc; 
} 

#articleinfo2 
{ 
    width:100%; 
    height:10em; 
    display: block; 
    margin-bottom: 5em; 
} 

#articleText2{ 
    width: 90%; 
    height:70%; 
    margin: 5%; 
    font-family: 'Roboto', sans-serif; 
    font-weight: 300; 
    font-size: 30px; 
    color: black; 
} 
+1

因爲您的工作1-8項目的底部有巨大的底邊,所以ID也應該是唯一的,不能重複。如果您需要重複某些事情,請使用班級 – Huangism

回答

0

在盒子底部的標題有一個大的高度設置和對他們大比分底,像這樣

#articleinfo2 { 
    margin-bottom: 5em; 
    height: 10em 
} 

去除這個10em高度在這個模型狀態中似乎沒有太大的影響,除非它確實使得這個差距更小了

0
#work{ 
    width: 100%; 
    height: 10em; 
    position: relative; /*TRY REMOVING THIS*/ 
    top: -11em; 
} 
相關問題