在库中添加随机空间。这不是填充?

时间:2017-11-14 10:23:48

标签: html css

在这个画廊上工作我无法弄清楚为什么它会在画廊内侧的右侧添加额外的空间。蓝色边框就在那里展示画廊窗口,最终将被带走。这就是我在画廊中的所有内容。

* {
  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{
	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;
}

小提琴:https://jsfiddle.net/3crrxdax/5/谢谢。

<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="christian@gmail.com">...@gmail.com</a>
  </footer>
</main>
  protected void onStart() {
    super.onStart();

    // Reset score
    Configs.score = 0;
    scoreTxt.setText(String.valueOf(Configs.score));


    // Set progressBar and start the gameTimer
    pb = (ProgressBar)findViewById(R.id.gbProgressBar);
    progress = 0;
    pb.setProgress((int) progress);
    startGameTimer();


    // Get a random circle for letters
    Random r = new Random();
    randomCircle = r.nextInt(Configs.circlesArray.length);


    // Reset taps count
    tapsCount = -1;


    // Get a random word from words string-array
    getRandomWord();
}

1 个答案:

答案 0 :(得分:0)

删除width: 1500px;并进行更新以使其更好看

&#13;
&#13;
* { 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;
  margin: 10px 11px;
  padding: 2px;
  border: 2px solid #FFFF20;
  width: fit-content;
  float: left;
}

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{
	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;
  clear: both;
	
}

.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;
  
}
&#13;
<!Doctype html>	
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>CDC Shop</title>
	<link rel="stylesheet" type="text/css" href="../test3.css">
</head>

<body>
<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="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>
	Copyright &copy; 2017 CDCShop <br>
		<a href="christian@gmail.com">ccoburn713@gmail.com</a>
</footer>
</main>
</body>
</html>
&#13;
&#13;
&#13;