Bootstrap offset is not working

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Bootstrap offset is not working



I'm just trying to experiment with Bootstrap and I cannot make the offset to work and I don't know why. Here's my code:




<div class="container">
<div class="row justify-content-between align-items-stretch">
<div class="col-4 offset-2"> ABC </div>
<div class="col-4"> DEF </div>
</div>
</div>



For some reason the offset-2 doesn't move the column at all. Do you know why?


offset-2



Thanks in advance,





jsfiddle.net/j7gmLs8z It is working. Have you imported Bootstrap correctly?
– Sujata Chanda
Aug 6 at 5:45





i will try that thank you very much Sujata
– user9964709
Aug 6 at 6:10





@SujataChanda - which version of Bootstrap?
– Sebastian Brosch
Aug 6 at 8:00




1 Answer
1



Hope this will work according to your requirements:-




<!DOCTYPE html>
<html lang="en">

<head>

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>

<body>
<div class="container">
<div class="row justify-content-between align-items-stretch">

<div class="col-4 col-md-offset-2">
ABC
</div>
<div class="col-4">
DEF
</div>
</div>
</div>

</body>

</html>





While this code may answer the question, providing additional context regarding why and/or how this code answers the question improves its long-term value.
– Elletlar
Aug 6 at 8:39





Breaking it down, here’s how it works: 1.Containers provide a means to center and horizontally pad your site’s contents. Use .container for a responsive pixel width or .container-fluid for width: 100% across all viewport and device sizes. 2.In a grid layout, content must be placed within columns and only columns may be immediate children of rows. 3.Column classes indicate the number of columns you’d like to use out of the possible 12 per row. So, if you want three equal-width columns across, you can use .col-4.
– VISHNU PRASAD
Aug 6 at 8:55





4.there are column prefixes to enhance columns in wide varients of devices available examples are: .col-,.col-sm(540px),.col-md-(720px) etc...
– VISHNU PRASAD
Aug 6 at 8:55





Thanks that looks great, but it is best to "edit" the answer and put all the info in there. Cheers!
– Elletlar
Aug 6 at 9:03






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered