T
T
trytrytry2013-12-25 15:09:09
Bootstrap
trytrytry, 2013-12-25 15:09:09

How to layout with bootstrap?

<div class="container">
    <div class = "row-fluid">
      <p>
        <div class = "span9 offset2 well">
        <b>Welcom </b>
         
            
        </div>
      </p>
    </div>
    
    <div class="container-fluid">
    <div class="row-fluid">
      <div class="span2 well" > 
          <!--Sidebar content-->		
          <h5><a href = сылка №1</a></h5>
          <h5><a href = ссылка №2</a></h5>
          <h5><a href =ссылка № 3</a></h5>			
      </div>
    
      <div class="span10 offset 5 " >
      
        {% block main %}
        {% endblock %}		  
      </div>
    </div>
      <div class="container-center">
       <div class = "span6 offset3">
       <hr>
      <p class="pull-right muted">(c) *******</p>
      </div>	
      </div>
    
  </div>
  </div>

I am writing the layout, but for some reason span2 does not work. And links and welcome go in blocks one after another. What could be wrong?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Melnikov, 2013-12-25
@trytrytry

start by switching to bootxtrap 3
, secondly, your layout is "broken" (a lot of unnecessary spaces and p tags),
thirdly, you definitely have bootstrap 2 there

<div class="container">
  <div class="row-fluid">
    <div class="span9 offset2">
      <div class="well">
        <b>Welcom</b>
      </div>
    </div>
  </div>
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span2">
        <div class="well">
          <!--Sidebar content-->
          <h5><a href="#">сылка №1</a></h5>
          <h5><a href="#">ссылка №2</a></h5>
          <h5><a href="#">ссылка №3</a></h5>
        </div>
      </div>
      <div class="span10">
        {% block main %}
        {% endblock %}
      </div>
    </div>
    <div class="container-center">
      <div class="span6 offset3">
        <hr>
        <p class="pull-right muted">(c) *******</p>
      </div>
    </div>
  </div>
</div>

I corrected it, try it yourself,
and in general, learn layout

R
Ruslan Lopatin, 2013-12-25
@lorus

You somehow completely misunderstood about the columns. Why did you write offset5 for example? span10 offset5 is generally the devil knows what. In total - 15 columns, although bootstrap assumes only 12 of them.

K
krontill, 2015-01-09
@krontill

And I have a question for you. What do you use so that {% block main %}, {% endblock %} include pieces of html code like this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question