Code looks like this:
<div class="row">
<div class="span4 alert alert-info">My Alert</div>
</div>
This doesn't work. Ideas?
I'm looking for a solution that doesn't involve me hardcoding widths anywhere.
Add class . text-center to the parent div to align text or any item inside to the center. You can also decide how the alignment should look like on the specific screen sizes.
To center the JavaScript alert box, you need to use the custom alert box. Under that, style it accordingly and position it to the center. Use the “top” and “left” CSS properties to achieve this. Set them as 50%, but as you can see the button below, so the property to 40% for correct alignment.
Use the . alert-link utility class to quickly provide matching colored links within any alert. This is a primary alert with an example link.
Assuming you're using the default 12 column grid:
<div class="row">
<div class="span4 offset4 alert alert-info">My Alert</div>
</div>
See Offsetting columns on the grid system section of the docs.
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