2017-11-14 4 views
0

このギャラリーで働くなぜ私はギャラリーの内側の右側に余分なスペースを追加しているのか分かりません。青色の枠線は、ギャラリーウィンドウを表示するためだけにあり、最終的に削除されます。これはギャラリーCSSのすべてです。ギャラリー内にランダムなスペースが追加されています。それは詰め物ではない?

.gallery { 
    display: -ms-flexbox; 
    display: flex; 
    justify-content: space-between; 
    -webkit-justify-content: space-around; 
    -ms-flex-pack: justify; 
    margin: 0 auto; 
    border: 2px solid blue; 
} 

フィドル:https://jsfiddle.net/3crrxdax/5/ありがとう。

* { 
 
    box-sizing: border-box; 
 
    font-family: Georgia, Arial, sans-serif; 
 
} 
 

 
html { 
 
    background-color: #FFFF20; 
 
} 
 

 
body { 
 
    background-color: #FFFF20; 
 
    height: 100%; 
 
} 
 

 
#wrapper { 
 
    width: 1500px; 
 
    height: 100%; 
 
    margin: auto; 
 
    background-color: #233237; 
 
    color: #FFFF20; 
 
    box-shadow: 5px 5px 5px #000000; 
 
} 
 

 
header { 
 
    color: #FFFF20; 
 
    font: Georgia, serif; 
 
    text-align: center; 
 
} 
 

 
h1 { 
 
    background-image: url(ebaylogo.png); 
 
    background-repeat: no-repeat; 
 
    background-position: right; 
 
    height: 72px; 
 
    background-size: 120px; 
 
    line-height: 200%; 
 
    margin-bottom: 0; 
 
} 
 

 
h3 { 
 
    text-align: center; 
 
    padding-top: 50px; 
 
    padding-bottom: 5px; 
 
} 
 

 
h3, 
 
.smallp { 
 
    margin: 0; 
 
} 
 

 
nav { 
 
    text-align: center; 
 
    font-weight: bold; 
 
} 
 

 
nav a { 
 
    text-decoration: none; 
 
    color: #FFFF20; 
 
} 
 

 
nav ul li { 
 
    list-style-type: none; 
 
    display: inline; 
 
    margin-right: 30px; 
 
    padding: 2px; 
 
    border: 2px solid #FFFF20; 
 
} 
 

 
footer { 
 
    padding-top: 50px; 
 
    font-size: .70em; 
 
    font-style: italic; 
 
    text-align: center; 
 
    color: #FFFF20; 
 
    margin: auto; 
 
    text-align: center; 
 
} 
 

 
footer a { 
 
    color: #FFFF20; 
 
} 
 

 
main { 
 
    padding: 0px 20px 0px 20px; 
 
    display: block; 
 
} 
 

 
.unorderedlist { 
 
    display: flex; 
 
    display: -ms-flexbox; 
 
    flex-wrap: wrap; 
 
    -ms-flex-pack: justify; 
 
    border: 1px blue solid; 
 
    justify-content: space-between; 
 
    -webkit-flex-wrap: wrap; 
 
    -ms-flex-flow: row wrap; 
 
    padding-left: 0px; 
 
    list-style-type: none; 
 
    margin: 100px auto; 
 
    width: 60%; 
 
    height: 100%; 
 
    text-align: center; 
 
} 
 

 
.list { 
 
    padding-bottom: 50px; 
 
    background-color: #18121E; 
 
    width: 220px; 
 
    height: 375px; 
 
    box-shadow: 5px 5px 5px; 
 
    margin-bottom: 25px; 
 
} 
 

 
.list a { 
 
    text-decoration: none; 
 
    color: #FFFF20; 
 
} 
 

 
.smallp { 
 
    color: #FFFF20; 
 
    width: 300px; 
 
} 
 

 
.smallp2 { 
 
    width: 300px; 
 
} 
 

 
.secondh3 { 
 
    text-align: center; 
 
    margin-bottom: -15px; 
 
} 
 

 
.pawnstarimg { 
 
    margin-top: 50px; 
 
    border: 2px solid #FFFF20; 
 
} 
 

 
.peaceimg { 
 
    border: 2px solid #FFFF20; 
 
    order: 4; 
 
    -ms-flex-order: 4; 
 
} 
 

 
.malebox a { 
 
    color: #FFFF20; 
 
} 
 

 
.femalebox a { 
 
    color: #FFFF20; 
 
} 
 

 
a:hover { 
 
    color: #0000FF; 
 
} 
 

 

 
/** a:visited{ 
 
\t color:#000000; 
 
Able to check a:hover without clearing cache 
 
}**/ 
 

 
a:active { 
 
    color: #00FF00; 
 
} 
 

 
.test { 
 
    display: flex; 
 
    display: -ms-flexbox; 
 
    flex-wrap: wrap; 
 
    -webkit-flex-wrap: wrap; 
 
    -ms-flex-flow: row wrap; 
 
    width: 60%; 
 
    margin: auto; 
 
    justify-content: space-around; 
 
    -ms-flex-pack: justify; 
 
} 
 

 
.testbox2 { 
 
    display: flex; 
 
    display: -ms-flexbox; 
 
    flex-direction: column; 
 
    -webkit-box-direction: normal; 
 
    -ms-flex-direction: column; 
 
} 
 

 
.testbox3 { 
 
    display: flex; 
 
    display: -ms-flexbox; 
 
    flex-direction: column; 
 
    -webkit-box-direction: normal; 
 
    -ms-flex-direction: column; 
 
} 
 

 
.gallery { 
 
    display: -ms-flexbox; 
 
    display: flex; 
 
    justify-content: space-between; 
 
    -webkit-justify-content: space-around; 
 
    -ms-flex-pack: justify; 
 
    margin: 0 auto; 
 
    border: 2px solid blue; 
 
} 
 

 
.gallery>div { 
 
    padding: 5px; 
 
} 
 

 
.gallery>div>img { 
 
    display: block; 
 
    transition: .3s transform; 
 
} 
 

 
.gallery>div:hover { 
 
    z-index: 1; 
 
} 
 

 
.gallery>div:hover>a>img { 
 
    transform: scale(2.5, 2.5); 
 
    transition: .2s transform; 
 
} 
 

 
.cf:before, 
 
.cf:after { 
 
    display: table; 
 
    content: ""; 
 
    line-height: 0; 
 
}
<main id="wrapper"> 
 
    <header> 
 
    <h1>CDC Shop</h1> 
 
    </header> 
 

 

 
    <nav> 
 
    <ul> 
 
     <li> <a href="../index.html">Home</a></li> 
 
     <li> <a href="../shirts/shirts.html">Shirts</a></li> 
 
     <li> <a href="../pants/pants.html">Pants</a></li> 
 
     <li> <a href="../pants/pants.html">Jackets</a></li> 
 
     <li> <a href="../pants/pants.html">Shoes</a></li> 
 
     <li> <a href="../pants/pants.html">Contact</a></li> 
 
    </ul> 
 
    </nav> 
 

 

 

 
    <div class="gallery"> 
 
    <div> 
 
     <a href="angels.gif"><img src="angels.gif" height="150px" width="75px" /> 
 
    </div> 
 
    <div> 
 
     <a href="angels2.jpg"><img src="angels2.jpg" height="150px" width="75px" /> 
 
    </div> 
 
    </div> 
 

 

 
    <footer> 
 
    Copyright &copy; 2017 CDCShop <br> 
 
    <a href="[email protected]">[email protected]</a> 
 
    </footer> 
 
</main>

+0

あなたは1のためのあなたのリンクに欠けているよく見にそれを作るために。あなたのフィドルからスニペットを作成すると、投稿したものよりも多くのCSSが表示されます – mplungjan

答えて

0

width: 1500px;を削除し、更新が

* { box-sizing: border-box; 
 
font-family: Georgia, Arial, sans-serif; 
 
} 
 

 
html{ 
 
\t 
 
\t background-color:#FFFF20; 
 
\t 
 
\t 
 
} 
 

 
body{ 
 
\t 
 
\t background-color:#FFFF20; 
 
\t height:100%; 
 
} 
 

 

 
#wrapper { //width: 1500px; 
 
\t \t height:100%; 
 
      margin: auto; 
 
\t \t background-color: #233237; 
 
\t \t color: #FFFF20; 
 
\t \t box-shadow: 5px 5px 5px #000000; 
 
} 
 

 
header{ 
 
\t 
 
\t color: #FFFF20; 
 
\t font: Georgia, serif; 
 
\t text-align: center; 
 
\t 
 
} 
 

 
h1{ 
 
\t background-image: url(ebaylogo.png); 
 
\t background-repeat: no-repeat; 
 
\t background-position: right; 
 
\t height: 72px; 
 
\t background-size: 120px; 
 
\t line-height: 200%; 
 
\t margin-bottom: 0; 
 
\t 
 
} 
 

 
h3{ 
 
\t text-align:center; 
 
\t padding-top:50px; 
 
\t padding-bottom:5px; 
 
} 
 

 
h3, .smallp{ 
 
margin:0; 
 
} 
 

 
nav{ 
 
\t text-align: center; 
 
\t font-weight: bold; 
 
\t 
 
} 
 

 
nav a{ 
 
\t text-decoration: none; 
 
\t color:#FFFF20; 
 
} 
 

 
nav ul li { 
 
    list-style-type: none; 
 
    margin: 10px 11px; 
 
    padding: 2px; 
 
    border: 2px solid #FFFF20; 
 
    width: fit-content; 
 
    float: left; 
 
} 
 

 
footer{ 
 
\t padding-top: 50px; 
 
\t font-size: .70em; 
 
\t font-style: italic; 
 
\t text-align: center; 
 
\t color: #FFFF20; 
 
\t margin:auto; 
 
\t text-align:center; 
 
\t 
 
} 
 
footer a{ 
 
\t color: #FFFF20; 
 
} 
 

 
main{ 
 
\t padding: 0px 20px 0px 20px; 
 
\t display: block; \t 
 
} 
 

 
.unorderedlist{ 
 
\t display: flex; 
 
\t display:-ms-flexbox; 
 
\t flex-wrap:wrap; 
 
\t -ms-flex-pack: justify; 
 
\t border: 1px blue solid; 
 
\t justify-content: space-between; 
 
\t -webkit-flex-wrap: wrap; 
 
    -ms-flex-flow: row wrap; 
 
\t padding-left:0px; 
 
\t list-style-type: none; 
 
\t margin: 100px auto; 
 
\t width:60%; 
 
\t height:100%; 
 
\t text-align:center; 
 
\t 
 
} 
 

 
.list{ 
 
\t padding-bottom: 50px; 
 
\t background-color: #18121E; 
 
\t width:220px; 
 
\t height:375px; 
 
\t box-shadow: 5px 5px 5px; 
 
\t margin-bottom:25px; 
 
} 
 

 
.list a{ 
 
\t text-decoration:none; 
 
\t color:#FFFF20; 
 
} 
 

 
.smallp{ 
 
\t color: #FFFF20; 
 
\t width:300px; 
 
} 
 

 
.smallp2{ 
 
\t width:300px; 
 
} 
 

 

 
.secondh3{ 
 
\t text-align:center; 
 
\t margin-bottom:-15px; 
 
\t 
 
} 
 

 

 

 
.pawnstarimg{ 
 
\t margin-top:50px; 
 
\t border: 2px solid #FFFF20; 
 
\t 
 
} 
 

 
.peaceimg{ 
 
\t border: 2px solid #FFFF20; 
 
order:4; 
 
-ms-flex-order: 4; 
 
} 
 

 
.malebox a { 
 
\t color:#FFFF20; 
 
} 
 

 
.femalebox a { 
 
\t color:#FFFF20; 
 
} 
 

 

 
a:hover{ 
 
\t color: #0000FF; 
 
} 
 

 
/** a:visited{ 
 
\t color:#000000; 
 
Able to check a:hover without clearing cache 
 
}**/ 
 

 
a:active { 
 
    color: #00FF00; 
 
} 
 
.test{ 
 
    display:flex; 
 
    display:-ms-flexbox; 
 
    flex-wrap:wrap; 
 
    -webkit-flex-wrap: wrap; 
 
    -ms-flex-flow: row wrap; 
 
    width:60%; 
 
    margin:auto; 
 
    justify-content:space-around; 
 
-ms-flex-pack: justify; 
 
} 
 

 
.testbox2{ 
 
    display:flex; 
 
    display:-ms-flexbox; 
 
    flex-direction:column; 
 
    -webkit-box-direction: normal; 
 
    -ms-flex-direction: column; 
 
    } 
 
    
 
.testbox3{ 
 
    display:flex; 
 
    display:-ms-flexbox; 
 
    flex-direction:column; 
 
    -webkit-box-direction: normal; 
 
    -ms-flex-direction: column; 
 
} 
 

 
.gallery { 
 
\t display:-ms-flexbox; 
 
\t display:flex; 
 
\t justify-content:space-between; 
 
\t -webkit-justify-content: space-around; 
 
\t -ms-flex-pack: justify; 
 
\t margin:0 auto; 
 
\t border:2px solid blue; 
 
    clear: both; 
 
\t 
 
} 
 

 
.gallery > div { 
 
    
 
    
 
    padding:5px; 
 
} 
 

 
.gallery > div > img { 
 

 
    display: block; 
 
    transition: .3s transform; 
 
    
 
} 
 

 
.gallery > div:hover { 
 
    z-index: 1; 
 
} 
 

 
.gallery > div:hover > a > img { 
 
    transform: scale(2.5,2.5); 
 
    transition: .2s transform; 
 
} 
 

 
.cf:before, .cf:after { 
 
    display: table; 
 
    content: ""; 
 
    line-height: 0; 
 
    
 
}
<!Doctype html> \t 
 
<html lang="en"> 
 
<head> 
 
\t <meta charset="utf-8"> 
 
\t <title>CDC Shop</title> 
 
\t <link rel="stylesheet" type="text/css" href="../test3.css"> 
 
</head> 
 

 
<body> 
 
<main id="wrapper"> 
 
<header> 
 
\t \t <h1>CDC Shop</h1> 
 
</header> 
 

 

 
<nav> 
 
\t <ul> 
 
\t <li> <a href="../index.html">Home</a></li> 
 
\t <li> <a href="../shirts/shirts.html">Shirts</a></li> 
 
     <li> <a href="../pants/pants.html">Pants</a></li> 
 
\t <li> <a href="../pants/pants.html">Jackets</a></li> 
 
\t <li> <a href="../pants/pants.html">Shoes</a></li> 
 
\t <li> <a href="../pants/pants.html">Contact</a></li> 
 
</ul> 
 
</nav> 
 

 

 

 
<div class="gallery"> 
 
    <div> 
 
    <a href="angels.gif"><img src="https://i.stack.imgur.com/m8iXH.jpg?s=328&g=1" height="150px" width="75px" /></a> 
 
    </div> 
 
    <div> 
 
    <a href="angels2.jpg"><img src="https://i.stack.imgur.com/m8iXH.jpg?s=328&g=1" height="150px" width="75px" /></a> 
 
    </div> 
 
</div> 
 

 

 
<footer> 
 
\t Copyright &copy; 2017 CDCShop <br> 
 
\t \t <a href="[email protected]">[email protected]</a> 
 
</footer> 
 
</main> 
 
</body> 
 
</html>

関連する問題