I want to build a page in bootstrap. It has different layout in different screen.
I wrote the code as below (If the code is wrong below, then how to write that?)
<div class="container-fluid">
<div class="row">
<!--Large screen starts here -->
<div class="col-lg-12">
<p class="page-top1"><small>Content 1</small></p>
<p class="page-top2">Content 2</p>
<p class="page-top3">Content 3</p>
</div>
<!--Large screen ends here -->
<!--Medium screen starts here -->
<div class="col-md-12">
<p class="page-top1"><small>Content 1</small></p>
<p class="page-top2">Content 2</p>
<p class="page-top3">Content 3</p>
</div>
<!--Medium screen ends here -->
<!--Small screem starts here -->
<div class="col-sm-6">
<p class="page-top1"><small>Content 1</small></p>
</div>
<div class="col-sm-3">
<p class="page-top2">Content 2</p>
</div>
<div class="col-sm-3">
<p class="page-top3">Content 3</p>
</div>
<!--Small scren ends here -->
</div>
</div>
So i thought if screen size is bigger, medium or small then col-lg, col-md or col-sm will be chooses automatically. But that doesn't happen. All the codes are running regardless of screen size.
If i have to write media query for each screen size, then which one i should use? Col-lg or col-md or col-sm? And why?
I hope it might be very basic silly question. But i just want to understand it.
Edit
Thanks for mentioning duplicate. With reference to the marked duplicate question i did the following changes.
<div class="container-fluid">
<div class="row">
<div class="col-lg-6 col-md-6 hidden-sm hidden-xs">
<p class="page-top1"><small>Content 1</small></p>
</div>
<div class="col-lg-3 col-md-3 hidden-sm hidden-xs">
<p class="page-top2">Content 2</p>
</div>
<div class="col-lg-3 col-md-3 hidden-sm hidden-xs">
<p class="page-top3">Content 3</p>
</div>
</div>
</div>
It worked fine. But there are some space between each p. What i need to do if that space should not be there. ref the image
Also i specify hidden-sm and hidden-xs. So in mobile screen this div should be hided right? Why the div is still showing?