Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery Mobile set width of 2 elements to 80% and 20%

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>
like image 862
Jongz Puangput Avatar asked May 02 '13 09:05

Jongz Puangput


2 Answers

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>
like image 122
Raji Avatar answered Sep 30 '22 20:09

Raji


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>
like image 36
Gajotres Avatar answered Sep 30 '22 18:09

Gajotres