I am using JQuery Mobile and am trying to set the width of two elements using ui-grid-a
as shown in the code below. The result is 2 elements whose width is equal to 50:50%
. I would like my input text width to be 80%
and my button to be 20%
in same line. How can do this?
<div data-role="footer" data-theme="a" class="ui-grid-a" data-position="fixed">
<div class="ui-block-a" >
<input id="outgoingMsg" placeholder="Your Message . . .">
</div>
<div class="ui-block-b" >
<div style="margin: 10px 0 0 0;">
<a id="callDialog" href="#dialog" type="button"
data-theme="b" data-rel="dialog"
data-transition="slidedown">Send</a>
</div>
</div>
</div>
You can override each grid column width.
<div class="ui-block-a" style="width:80%"><input id="outgoingMsg" placeholder="Your Message . . ."></div>
<div class="ui-block-b" style="width:20%" >
<div style="margin: 10px 0 0 0;">
<a id="callDialog" href="#dialog" type="button" data-theme="b" data-rel="dialog" data-transition="slidedown">Send</a>
</div>
</div>
Working example: http://jsfiddle.net/Gajotres/eFWRQ/
CSS :
#custom-footer .ui-block-a {
width: 80% !important;
}
#custom-footer .ui-block-b {
width: 20% !important;
}
HTML :
<div data-role="footer" data-theme="a" class="ui-grid-a" id="custom-footer" data-position="fixed">
<div class="ui-block-a" ><input id="outgoingMsg" placeholder="Your Message . . ."></div>
<div class="ui-block-b" >
<div style="margin: 10px 0 0 0;">
<a id="callDialog" href="#dialog" type="button" data-theme="b" data-rel="dialog" data-transition="slidedown">Send</a>
</div>
</div>
</div>
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