Having a fixed width div:
// CSS
@media only screen
.column.small-centered:last-child, .columns.small-centered:last-child {
float: none;
}
.lesson_lt_mc_div .small-centered {
margin-top: 15px;
margin-bottom: 15px;
width: 296px;
}
foundation.css:1@media only screen
.column.small-centered, .columns.small-centered {
margin-left: auto;
margin-right: auto;
float: none;
}
.text-left {
text-align: left !important;
}
// HTML
<div class="small-3 small-centered text-left columns">
<input type="radio" name="lt_mc_ans" value="1" id="lt_mc_ans_1"><span> 1. </span>
<label for="lt_mc_ans_1">I</label>
<br>
<input type="radio" name="lt_mc_ans" value="2" id="lt_mc_ans_2"><span> 2. </span>
<label for="lt_mc_ans_2">rsr rs rsrs rsrs r rrrs</label>
<br>
<input type="radio" name="lt_mc_ans" value="3" id="lt_mc_ans_3"><span> 3. </span>
<label for="lt_mc_ans_3">Very</label>
<br>
<input type="radio" name="lt_mc_ans" value="4" id="lt_mc_ans_4"><span> 4. </span>
<label for="lt_mc_ans_4">She</label>
</div>
The purpose of having a fixed width is to center the div while aligning the text to the left. However, it causes an issue when the text wraps due to its length, making the options appear distorted.
Is there a way to adjust the div width dynamically using jQuery or JavaScript? (While considering any possible CSS alternatives).