Как в Bootstrap выстроить div в один ряд? Курс BootStrap урок 31.

0

Вот мой код если что. Это ток индекс могу скинуть стили.

<!DOCTYPE html>
<html lang="ru">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Киномонстр Bootstrap</title>

    <!-- Bootstrap -->
    <link href="assets/css/bootstrap.min.css" rel="stylesheet">

    <!-- Main Style -->
    <link href="assets/css/style.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    

    <div class="container-fluid">
      <div class="row">
       
       <nav role="navigation" class="navbar navbar-inverse">
          <div class="container">

          <div class="navbar-header header">

            <div class="container">
              
              <div class="row">
                
                <div class="col-lg-12">
                  <h1><a href="#">КиноМонстр</a></h1> 
                  <p>Кино - наша страсть!</p>
                </div>

              </div>

            </div>

            
            <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
              
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>

            </button>
          

          </div>
            
            <div id="navbarCollapse" class="collapse navbar-collapse navbar-right">
              
              <ul class="nav nav-pills">
                <li class="active"> <a href="#">Главная</a> </li>
                <li> <a href="#">Фильмы</a> </li>
                <li> <a href="#">Сериалы</a> </li>
                <li> <a href="#">Рейтинг фильмов</a> </li>
                <li> <a href="#">Контакты</a> </li>

              </ul>


            </div>

          </div>
       </nav> 

      </div>
    </div>


    <div class="wrapper">
      
      <div class="container">
        
        <div class="row">
          
        <div class="col-lg-9 col-lg-push-3"> <!-- Меняем блоки местами col-lg-push-3 -->
          <h2>Новые фильмы</h2>
          <hr>
          <div class="row">

            <div class="films_block col-lg-3 col-md-3 col-sm-3 col-xs-6">
              <img src="assets/img/inter.png" alt="Интерстеллар">
              <div class="film_label">Интерстеллар</div>

              <div class="films_block col-lg-3 col-md-3 col-sm-3 col-xs-6">
              <img src="assets/img/matrix.png" alt="матрица">
              <div class="film_label">Матрица</div>

              <div class="films_block col-lg-3 col-md-3 col-sm-3 col-xs-6">
              <img src="assets/img/cloud.png" alt="облачный атлас">
              <div class="film_label">Облачный Атлас</div>

              <div class="films_block col-lg-3 col-md-3 col-sm-3 col-xs-6">
              <img src="assets/img/max.png" alt="безумный макс">
              <div class="film_label">Безумный макс</div>

            </div>
          </div>
        </div>


        <div class="col-lg-3 col-lg-pull-9"> <!-- Меняем блоки местами col-lg-pull-9 -->
         
        </div>      


        </div>

      </div>

      <div class="clear"></div>

    </div>


    <footer>
      
      <div class="container">
        <p class="text-center"> <a href="http://ru.wh-db.com">WH-DB.COM</a> </p>
      </div>

    </footer>




    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="assets/js/bootstrap.min.js"></script>
  </body>
</html>









<!-- STYLE CSS-->
.header a, a:hover {
	color: #f0ad4e;
	text-decoration: none;
}

.header h1 {
	letter-spacing: 15px;
	font-size: 300%
}

.header p {
	color: white !important;
	font-size: 90%;
	letter-spacing: 3px;
}


.nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover {
    color: #fff;
    background-color: #346270;
}

.nav-pills>li>a {
	color: #fff;
}

.nav-pills>li>a:hover {
	background-color: #346270;
}


.navbar-inverse {
    padding: 1%;
}

@media (max-width: 767px) {
	.nav-pills>li {
		float: none;
	}

	.nav-pills {
		text-align: center;
	}

	.header h1 {
		letter-spacing: 5px;
		font-size: 280%;
	}

	.header {
		text-align: center;
	}
}

.clear {
	clear: both;
	width: 63px;
}

.wrapper {
	min-height: 100%;
}

html, body {
	height: 100%;
}

footer {
	color: #666;
	background-color: #222;
	padding: 17px 0 18px 0;
	border:1px solid #000;
}

footer a {
	color: #999;
}

footer a:hover {
	color: #efefef;
	text-decoration: none;
}


bootstrap

3 ответов

1

У вас div вроде не закрытые, посмотрите этот код и сравните с вашим:

https://fructcode.com/ru/courses/bootstrap/interactive-main-page-films-block/

1

1

а да

Sign up or Log in to write an answer