Skip to content Skip to sidebar Skip to footer

Added A Space Between An Image And A Div Using Bootstrap

Solution 1:

<div class="row">
    <div class="col-md-2">
        <div class="yourAdditionalMarginClass">
            <img id="image" src="img.png" class="img-responsive">
        </div>
    </div>
    <div class="col-md-4">   
        <div id="otherPart"> ... </div>
    </div>
</div>

The image is responsive now, the basic padding of the col's is applied and if you need even more padding/margin, wrap another div around the image, give it a class and apply your styles to that class.


Solution 2:

Remove the col-md-2 from the image and add it to the outer most div like:

<div class="row col-md-2">
    ...
</div>

Solution 3:

Try this way

<div class="row">
    <div class=" col-md-2">
        <img id="image" src="img.png">
    </div>
    <div id="otherPart" class="col-md-4">           
    </div>
</div>

Post a Comment for "Added A Space Between An Image And A Div Using Bootstrap"