2016-04-06 3 views
0

基本的に私はthis designを達成しようとしていましたが、thisは私がこれまでに得たものです。サイドバーが底にくっついていない、その他の間違い

  • は、サイドバーには、ページの下部に付着しない...あなたはそれを見ることができるように

    エラーをたくさん持っているが、私はそれらを修正する方法がわからない

  • それは私が何か間違ったことをした私はそうするならば、

  • はまた、メニューやロゴがそこに滞在するために移動するので、私はサイドバーにpaddingを追加することはできません。ここで

はコードです:

* { 
 
    font-family: Arial; 
 
} 
 
body { 
 
    background: url(bg.jpg) no-repeat; 
 
    background-size: 100%; 
 
    height: auto; 
 
    width: 850px; 
 
    margin: 0 auto; 
 
    background-attachment: scroll; 
 
    background-position: center; 
 
} 
 
header { 
 
    background: #343843; 
 
    color: white; 
 
    height: 80px; 
 
} 
 
header a { 
 
    color: #24272e; 
 
    background: aqua; 
 
    text-decoration: none; 
 
    padding: 60px 40.5px; 
 
} 
 
nav { 
 
    background: #24272e; 
 
    color: white; 
 
    height: 30px; 
 
    width: 675px; 
 
    float: right; 
 
} 
 
nav ul { 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 
nav ul li { 
 
    list-style: none; 
 
    display: inline-block; 
 
    padding: 5px 10px; 
 
    margin-left: -10; 
 
} 
 
nav ul li a { 
 
    color: white; 
 
    text-decoration: none; 
 
    font-size: 14px; 
 
    font-weight: bold; 
 
    padding: 5px 10px; 
 
} 
 
section { 
 
    background: #ffffff; 
 
    color: darkgray; 
 
    width: 675px; 
 
    float: right; 
 
} 
 
article { 
 
    background: #fff; 
 
    color: #000; 
 
} 
 
aside { 
 
    background: #343843; 
 
    float: left; 
 
    width: 175px; 
 
    height: 100%; 
 
    display: inline-block; 
 
    margin-top: -30px; 
 
} 
 
footer { 
 
    background: #20232a; 
 
    position: relative; 
 
    margin-top: -65px; 
 
    clear: both; 
 
    width: 100%; 
 
}
<!DOCTYPE html> 
 

 
<html lang="es"> 
 

 
<head> 
 
    <title>Titulo de la web</title> 
 
    <meta charset="utf-8" /> 
 
    <link rel="stylesheet" href="style.css" /> 
 
</head> 
 

 
<body> 
 
    <header> 
 
    <a href="index.html" class="logo">Condominios</a> 
 
    </header> 
 
    <nav> 
 
    <ul> 
 
     <li><a href="index.html" tittle="home">Home</a> 
 
     </li> 
 
    </ul> 
 
    </nav> 
 
    <section> 
 
    <article> 
 
     <h2>Titilo de contenido</h2> 
 
     <p>Contenido</p> 
 
    </article> 
 
    </section> 
 
    <aside> 
 
    <h3>Titulo de contenido</h3> 
 
    <p>contenido</p> 
 
    </aside> 
 
    <footer> 
 
    Creado 
 
    </footer> 
 
</body> 
 

 
</html>

+1

左側のサイドバーでは、親の背景を使用することをおすすめします。 –

答えて

1

はあなたのhtmlbodyheight:100%を追加し、いくつかは、それが動作微調整...

html, 
 
body { 
 
    height: 100% 
 
} 
 
body { 
 
    background: url(bg.jpg) no-repeat; 
 
    background-size: 100%; 
 
    background-attachment: scroll; 
 
    background-position: center; 
 
    width: 850px; 
 
    margin: 0 auto; 
 
    font-family: Arial 
 
} 
 
header { 
 
    background: #343843; 
 
    color: white; 
 
    height: 80px; 
 
} 
 
header a { 
 
    color: #24272e; 
 
    background: aqua; 
 
    text-decoration: none; 
 
    padding: 60px 40.5px; 
 
} 
 
nav { 
 
    background: #24272e; 
 
    color: white; 
 
    height: 30px; 
 
    width: 675px; 
 
    float: right; 
 
} 
 
nav ul { 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 
nav ul li { 
 
    list-style: none; 
 
    display: inline-block; 
 
    padding: 5px 10px; 
 
    margin-left: -10; 
 
} 
 
nav ul li a { 
 
    color: white; 
 
    text-decoration: none; 
 
    font-size: 14px; 
 
    font-weight: bold; 
 
    padding: 5px 10px; 
 
} 
 
section { 
 
    background: #ffffff; 
 
    color: darkgray; 
 
    width: 675px; 
 
    float: right; 
 
    height: 100%; 
 
    background: red 
 
} 
 
article { 
 
    background: #fff; 
 
    color: #000; 
 
} 
 
aside { 
 
    background: #343843; 
 
    float: left; 
 
    width: 175px; 
 
    height: 100%; 
 
    display: inline-block; 
 
    margin-top: -30px; 
 
    height: calc(100% + 30px) 
 
} 
 
footer { 
 
    background: #20232a; 
 
    position: relative; 
 
    margin-top: -65px; 
 
    clear: both; 
 
    width: 100%; 
 
}
<header> 
 
    <a href="index.html" class="logo">Condominios</a> 
 
</header> 
 
<nav> 
 
    <ul> 
 
    <li><a href="index.html" tittle="home">Home</a> 
 
    </li> 
 
    </ul> 
 
</nav> 
 
<section> 
 
    <article> 
 
    <h2>Titilo de contenido</h2> 
 
    <p>Contenido</p> 
 
    </article> 
 
</section> 
 
<aside> 
 
    <h3>Titulo de contenido</h3> 
 
    <p>contenido</p> 
 
</aside> 
 
<footer> 
 
    Creado 
 
</footer>

+0

私はそれをしました。これは何が起こるかhttp://postimg.org/image/42nkmb7vb/ –

+0

@JairoGil更新された回答を見る – dippas

関連する問題