I am facing a challenge with aligning some text next to a Twitter button while ensuring that they are all lined up neatly within borders. The issue I encountered is that the text div shrinks and floats to the upper left corner along with its borders, unlike the button which is properly aligned thanks to Bootstrap. Both the text and button divs have padding or margin issues preventing the borders from forming a rectangle with a clear border line between them.
What I envision:
The 1px grey borders should be equal on all sides, but due to difficulties with my touchpad, this was not achieved.
This is my current setup:
<div class="mydiv">
<div class="row">
<div class="col-md-12">
<div class="col-sm-6">
<div class="textdiv">
Text!
</div>
</div>
<div class="col-sm-6">
<div class="btndiv">
<a class="btn" href="#">Button!</a>
</div>
</div>
</div>
</div>
</div>
CSS:
.textdiv {
border-top: 1px solid #DDDDDD;
border-left: 1px solid #DDDDDD;
border-right: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
margin: 0 auto;
}
.btndiv {
border-top: 1px solid #DDDDDD;
border-bottom: 1px solid #DDDDDD;
border-right: 1px solid #DDDDDD;
}
.mydiv {
width:30%;
}