Textbox and Button Levels in mobile view

青春壹個敷衍的年華 提交于 2019-12-08 06:38:06

问题


I would like to create a big Textbox with two buttons below (for mobile view only). I got the psd file from a graphic designer, and my design works for Desktop and Tablet, but the only problem is with Mobile view. Here are few lines of code

    <div  style="text-align:center" class="container">
    <h2 >Books Search!</h2>
    <div  class="row" >
    <input type="text"class=" col-xs-11 col-mid-8 " ></input>
    <input type="button" class=" col-xs-3 col-md-3 btn-primary" Text="Search Book"/>
    <input type="button" class="col-xs-3 col-md-3 btn-success" value="Advance Search"></input>
    </div>
    </div>

This will give the following screen shot on mobile

and I want to get the following view when a user opens the website in his/her mobile, I already read the bootstrap document, I tried different ways "as mentioned in their examples" but none works to display the following design Can anyone tell me please, where is the error? thanks


回答1:


Try changing your column classes to:

<div class="row">
    <input type="text" class=" col-xs-12 col-sm-6 "></input>
    <input type="button" class=" col-xs-6 col-sm-3 btn-primary" value="Search Book" />
    <input type="button" class="col-xs-6 col-sm-3 btn-success" value="Advance Search"></input>
</div>

FIDDLE



来源:https://stackoverflow.com/questions/29868198/textbox-and-button-levels-in-mobile-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!