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
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.
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.
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.
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.
specify a bootstrap class row
or row-fluid
<div id="Second" class="row">
</div>
Plunker DEMO
Read Bootstrap Scaffolding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With