需要帮助在引导网格中并排对齐div

时间:2016-05-16 18:09:02

标签: html css twitter-bootstrap grid alignment

所以我在div中包含了3个图像,我使用了float:left;并且“向左拉”试图使图像彼此相邻,但它们不会出于某种原因。在我添加一个jQuery循环插件之前,它们并排排列,使图像成为单个幻灯片放映,淡入/淡出图像(在#Slideshow div中),在我添加了彼此叠加的脚本之后,我有不知道如何解决这个问题。

/*style sheet*/


#Backg
{
background-image: url("Graphics/ravenna.png");
background-repeat: repeat;
height: 100%;
}


/*Biggest Container and Pattern Backg*/
#PrimaryC {
padding: 10px;
background-image: url("Graphics/paper_fibers.png");
background-repeat: repeat;
height: 100%;
-moz-box-shadow: 0px 0px 20px #000000;
-webkit-box-shadow: 0px 0px 20px #000000;
box-shadow: 0px 0px 20px #000000;
}

#Header /*Retro Games Arcade Logo*/
{
height: 100px;
width: 100%;
background-image: url("Graphics/SiteLogo.png");
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center;
}  



.Content /*Holds Arcade Photo and Text in 2 columns*/
{
width: 100%;
height: 500px;
background-color: white;
resize: both;
border-radius: 0px 25px 25px 25px;
border: 1px solid white;

}

#HeaderText /*Title*/
{
font-family:'Rokkitt', serif;
font-size: 35px;
color: black;
text-decoration: underline;
padding-right: 20px;
}

#RegularText /*Main Text Body*/
{


font-family:'Rokkitt', serif;
font-size: 18px;
padding-right: 20px;
}

.dropcap
{ float: left;
 color: #903;
 font-size: 75px;
 line-height: 60px;
 padding-top: 4px;
 padding-right: 8px;
 padding-left: 3px;
 font-family: Georgia; 
 }


#Arcade /*Arcade Photo*/
{
width: 100%;

}

/*Navigational Buttons*/
.post-content
{
font-family:'Didact Gothic', sans-serif;
font-size: 150%; /*20px*/
top: 120px;
left:15px;
position: relative;
 letter-spacing: 2px;

}

#RightRow
{
Position: relative;
}

.centerBlock
{
position: relative;
top: -200px;
padding-left: 10px;
}

#slideshow img
{
 float: left;
margin-right: 25px;
margin: 0;
position: relative;

}

#slideshow
{

margin:auto;

}




@keyframes slideshow
{
0% {background-color: white;]
50% {background-color: red;}
}

}


.col-md-12 
{
position: relative;



}




.footer-basic-centered{
background-color: #683025;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12);
box-sizing: border-box;
width: 100%;
text-align: center;
font: normal 18px sans-serif;
box-shadow: 0 5px 5px -5px black;
padding: 15px;
margin-top: 80px;
}

.footer-basic-centered .footer-company-motto{
color:  white;
font-size: 24px;
margin: 0;
font-family:'Rokkitt', serif; 
}

.footer-basic-centered .footer-company-name{
color:  #8f9296;
font-size: 14px;
margin: 0;
}

.footer-basic-centered .footer-links{
list-style: none;
font-weight: bold;
color:  #ffffff;
padding: 35px 0 23px;
margin: 0;
font-family: 'Didact Gothic', sans-serif;
}

.footer-basic-centered .footer-links a{
display:inline-block;
text-decoration: none;
color: inherit;
}



@media (max-width: 600px) {

	.footer-basic-centered{
		padding: 35px;
	}

	.footer-basic-centered .footer-company-motto{
		font-size: 18px;
	}

	.footer-basic-centered .footer-company-name{
		font-size: 12px;
	}

	.footer-basic-centered .footer-links{
		font-size: 14px;
		padding: 25px 0 20px;
	}

	.footer-basic-centered .footer-links a{
		line-height: 1.8;
	}
}


/*Desktop*/
#Home, #Stock, #AboutUs, #ContactUs
{
padding-bottom: 22px;
position: relative;
top: -360px;
}



/*Tablet Devices*/
@media (min-width: 768px) and (max-width: 969px) {
#Home, #Stock, #AboutUs, #ContactUs
{
padding-bottom: 18px;
position: relative;
top: -270px;
font-size: 50%;


}
}
/*Mobile Devices*/
@media(max-width: 767px) {
#Home, #Stock, #AboutUs, #ContactUs
{
padding-bottom: 18px;
position: relative;
font-size: 20%;
top: auto;
} 
.post-content
{
top: 20px;
font-size: 80px;
}
.Content
{
height: 600px;
}
}

/*1200*/
@media (min-width: 970px) and (max-width: 1119px) {
#Home, #Stock, #AboutUs, #ContactUs
{
padding-bottom: 25px;
position: relative;
top: -310px;
font-size: 60%;
}}
}
<!DOCTYPE html>
<html>
  <head>
    <meta name="generator"
    content="HTML Tidy for HTML5 (experimental) for Windows https://github.com/w3c/tidy-html5/tree/c63cc39" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="Styles.css" />
    <!--Main Style Sheet-->
    <link rel="stylesheet" href="bootstrap.min.css" />
    <!--Bootstrap Style Sheet-->
    <link href='https://fonts.googleapis.com/css?family=Permanent+Marker' rel='stylesheet' type='text/css' />
    <link href='https://fonts.googleapis.com/css?family=Press+Start+2P' rel='stylesheet' type='text/css' />
    <link href='https://fonts.googleapis.com/css?family=Rokkitt' rel='stylesheet' type='text/css' />
    <link href='https://fonts.googleapis.com/css?family=Didact+Gothic' rel='stylesheet' type='text/css' />
	<!--Fonts-->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
	<script type="text/javascript" src="http://malsup.github.com/jquery.cycle.all.js"></script>
	
<script type="text/javascript"> <!--Image Fade Script-->
$(document).ready(function() {
    $('.Slot').cycle({
		fx: 'fade' 
	});
});
</script>
	
	<title>Retro Games Arcade</title>
  </head>
  
  <body>
    <div id="Backg">
      <div id="PrimaryC" class="container">
        <!--Primary Container-->
        <div id="Header">
          <!--Site Logo-->
        </div>
        <div class="Content">
          <!--Main Content Container-->
          <div class="row">
            <!--Row 1-->
            <div class="col-sm-6">
              <!--Left Col-->
              <img src="Graphics/Arcade.png" id="Arcade" class="hidden-xs" />
              <div class="caption post-content">
                <div id="Home">home</div>
                <!--Home Button-->
                <div id="Stock">stock</div>
                <!--Stock Button-->
                <div id="AboutUs">about us</div>
                <!--About Us Button-->
                <div id="ContactUs">contact us</div>
                <!--Contact Us Button-->
              </div>

			</div>
            <div class="col-sm-6" id="RightRow">
              <!--RightCol-->
              <p id="HeaderText">Welcome to the Retro Games Arcade</p>
              <p id="RegularText">
              <span class="dropcap">H</span>ere you can find a treasure of Retro Video Games, sell your unwanted hardware/software;
              and also have our professional team repair any damaged hand-held gaming devices.
              <br />
              <br />We have one of the biggest collectecions of Retro Video Games in the UK, and have genres ranging from Puzzle
              Games and Platformers, to Roleplaying Games and Stratgey Games.
              <br />
              <br />Our staff have over 100 years combined experience of playing retro video games and a professional certified
              Nintendo technician, so if you want a recommendation for your
              <br />sons birthday present, or you need to get your old GameCube repaired; we are your guys.</p>
            </div>
          </div>
		  
		  
			<div class="col-md-6">
		  	<div id="slideshow" class="centerBlock hidden-xs hidden-sm hidden-md">
			  
			  <div class="Slot">
			  <img class="img-responsive" src="Graphics/IMG1.png" width="158" height="162">
			  <img class="img-responsive" src="Graphics/L1.png" width="158" height="162">
			  </div>
			  
			  <div class="Slot">
			  <img class="img-responsive" src="Graphics/IMG2.png" width="158" height="162">
			  <img class="img-responsive" src="Graphics/L2.png" width="158" height="162">
			  </div>
			  
			  <div class="Slot">
			  <img class="img-responsive" src="Graphics/IMG3.png" width="158" height="162">
			  <img class="img-responsive" src="Graphics/L3.png" width="158" height="162">
			  </div>
            
			</div>
		</div>
		  </div>
        <div class="row">
          <!--Row 3-->
          <div class="col-md-12">
            <img src="Graphics/Aracde3.png" id="Vector" class="img-responsive center-block" class="hidden-xs" />
          </div>
        </div>			 



		 </div>
	  
		  
		  
		  </div>
		  
		
		  
		  
		  
		  
		  
		  
		  
		  
		  
		  
        

        <footer class="footer-basic-centered">
          <p class="footer-company-motto">Expand Your Retro Playground.</p>
          <p class="footer-links">
          <a href="#">Home</a> · 
          <a href="#">Stock</a> · 
          <a href="#">About Us</a> · 
          <a href="#">Contact Us</a></p>
          <p class="footer-company-name">Retro Games Arcade ɠ2015</p>
        </footer>
      </div>
    </div>
  </body>
</html>

1 个答案:

答案 0 :(得分:0)

很难通读该代码,所以我不确定我是否瞄准了正确的区域。

我假设您希望这些图像在线:

<div class="col-md-6">
    <div id="slideshow" class="centerBlock hidden-xs hidden-sm hidden-md">
          <div class="Slot">
              <img class="img-responsive" src="Graphics/IMG1.png" width="158" height="162">
              <img class="img-responsive" src="Graphics/L1.png" width="158" height="162">
          </div>

          <div class="Slot">
              <img class="img-responsive" src="Graphics/IMG2.png" width="158" height="162">
              <img class="img-responsive" src="Graphics/L2.png" width="158" height="162">
          </div>

          <div class="Slot">
              <img class="img-responsive" src="Graphics/IMG3.png" width="158" height="162">
              <img class="img-responsive" src="Graphics/L3.png" width="158" height="162">
          </div> 
    </div>
</div>

只需使用bootstrap:

<div class="col-md-6">
    <div class="col-md-4">
        *images*
    </div>
    <div class="col-md-4">
        *images*
    </div>
    <div class="col-md-4">
        *images*
    </div>
</div>