如何使用@media在输入上方设置标签?(How to set labels above the input with @media?)

系统教程 行业动态 更新时间:2024-06-14 16:59:46
如何使用@media在输入上方设置标签?(How to set labels above the input with @media?)

我有简单的Bootstrap块,如下所示:

主要问题出现在较小的分辨率上,如1280 * 600:

正如你所看到的那样,没有看到ip的mos,所以我想在输入之上设置labes,如下所示:

<div class="form-horizontal" role="form"> <div class="form-group"> <label class="col-sm-3 control-label" for="textinput" style="text-align:center">Server IP</label> <div class="col-sm-4"> <input type="text" placeholder="Enter IP Address" class="form-control"> </div> <label class="col-sm-1 control-label" for="textinput">Port</label> <div class="col-sm-3"> <input type="text" placeholder="Enter Port" class="form-control"> </div> </div> </div>

I have simple Bootstrap block which looks like this:

The main problem occurs on smaller resolution, like 1280*600:

As you can see the mos of the ip is not seen, so I want to set labes above the inputs like this:

<div class="form-horizontal" role="form"> <div class="form-group"> <label class="col-sm-3 control-label" for="textinput" style="text-align:center">Server IP</label> <div class="col-sm-4"> <input type="text" placeholder="Enter IP Address" class="form-control"> </div> <label class="col-sm-1 control-label" for="textinput">Port</label> <div class="col-sm-3"> <input type="text" placeholder="Enter Port" class="form-control"> </div> </div> </div>

最满意答案

我假设你的意思是600x1280而不是相反,因为1280x600非常宽。

这样的事情怎么样..

<div class="form-horizontal" role="form"> <div class="form-group"> <div class="col-xs-7"> <div class="container-fluid"> <div class="row"> <label class="col-xs-12 col-sm-3 control-label" for="textinput" style="text-align:center">Server IP</label> <div class="col-xs-12 col-sm-9"> <input type="text" placeholder="Enter IP Address" class="form-control"> </div> </div> </div> </div> <div class="col-xs-5"> <div class="container-fluid"> <div class="row"> <label class="col-xs-12 col-sm-3 control-label" for="textinput">Port</label> <div class="col-xs-12 col-sm-9"> <input type="text" placeholder="Enter Port" class="form-control"> </div> </div> </div> </div> </div> </div>

I assume you mean 600x1280 rather than the other way round as 1280x600 is quite wide.

How about something like this..

<div class="form-horizontal" role="form"> <div class="form-group"> <div class="col-xs-7"> <div class="container-fluid"> <div class="row"> <label class="col-xs-12 col-sm-3 control-label" for="textinput" style="text-align:center">Server IP</label> <div class="col-xs-12 col-sm-9"> <input type="text" placeholder="Enter IP Address" class="form-control"> </div> </div> </div> </div> <div class="col-xs-5"> <div class="container-fluid"> <div class="row"> <label class="col-xs-12 col-sm-3 control-label" for="textinput">Port</label> <div class="col-xs-12 col-sm-9"> <input type="text" placeholder="Enter Port" class="form-control"> </div> </div> </div> </div> </div> </div>

更多推荐

本文发布于:2023-04-17 08:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/c7dda7a8bc912a6f2bbcbeeb59213440.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   标签   media   input   set

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!