Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Div below other div in bootstrap

I know this is kind of silly question but i m stuck with this for nearly 4 hours.I am new to bootstrap i m building a website for mobile view(and can also be viewed from desktop) using asp.net.I want a menu with collapse functionality in mobile i m using a div with class="navbar navbar-fixed-top" now i want another div that should come after this div.Here is my code

   <div class="navbar navbar-fixed-top"><!--First div-->
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </a>
      <a class="brand" href="#">Project name</a>
      <div class="nav-collapse">
        <ul class="nav">
          <li ><a href="#">Home</a></li>
          <li class="active"><a href="GridView.aspx">About</a></li>
          <li><a href="#contact">Contact</a></li>
        </ul>
      </div><!--/.nav-collapse -->

    </div>

  </div>

</div>
<div id="Second"> <h2 style="text-align:center;">I want this div to come after the above div</h2></div>

This gives proper output when i view in mobile but when i run in desktop i am not able to see the Second div.

Thanks

like image 435
Hitesh Avatar asked Mar 25 '14 11:03

Hitesh


People also ask

How do I place a div under another div?

Div itself is a block element that means if you add div then it would start from under the another div. Still you can do this by using the css property that is display:block; or assign width:100%; add this to the div which you want under another div.

How do I put one div after another?

With CSS properties, you can easily put two <div> next to each other in HTML. Use the CSS property float to achieve this. With that, add height:100px and set margin.

How do you keep a div at the bottom of the page?

Set the position of div at the bottom of its container can be done using bottom, and position property. Set position value to absolute and bottom value to zero to placed a div at the bottom of container.

How do you make one line with 3 divs?

Three or more different div can be put side-by-side using CSS. Use CSS property to set the height and width of div and use display property to place div in side-by-side format. float:left; This property is used for those elements(div) that will float on left side.


1 Answers

specify a bootstrap class row or row-fluid

<div id="Second" class="row">
</div>

Plunker DEMO

Read Bootstrap Scaffolding

like image 53
Murali Murugesan Avatar answered Oct 12 '22 18:10

Murali Murugesan