label和input放置在同一行,并且设置占比

本文介绍了一个日期选择器组件的实现方式,包括开始时间和结束时间的选择界面,并提供了查询按钮以进行数据检索操作。
部署运行你感兴趣的模型镜像

效果

这里写图片描述

代码

<div class="row chart-row">
    <div class="col-md-4">
        <form class="form-inline" role="form">
            <div class="input-group">
                <label for="dtp_input1" class="control-label">开始时间</label>
                <div id="start" class="input-group date form_date" data-date=""
                    data-date-format="MM-dd-yyyy" data-link-field="dtp_input1"
                    data-link-format="yyyy-mm-dd">
                    <input class="form-control" size="16" type="text" value=""
                        readonly> <span class="input-group-addon"><span
                        class="glyphicon glyphicon-remove"></span></span> <span
                        class="input-group-addon"><span
                        class="glyphicon glyphicon-calendar"></span></span>
                </div>
                <input type="hidden" id="dtp_input1" value="" />
            </div>
        </form>
    </div>
    <div class="col-md-4">
        <form class="form-inline" role="form">
            <div class="input-group">
                <label for="dtp_input2" class="control-label">结束时间</label>
                <div id="end" class="input-group date form_date" data-date=""
                    data-date-format="MM-dd-yyyy" data-link-field="dtp_input2"
                    data-link-format="yyyy-mm-dd">
                    <input class="form-control" size="16" type="text" value=""
                        readonly> <span class="input-group-addon"><span
                        class="glyphicon glyphicon-remove"></span></span> <span
                        class="input-group-addon"><span
                        class="glyphicon glyphicon-calendar"></span></span>
                </div>
                <input type="hidden" id="dtp_input2" value="" /><br />
            </div>
        </form>
    </div>
    <div class="col-md-2">
        <div class="form-inline">
            <button class="btn btn-primary" onClick="search()">查询</button>
        </div>
    </div>
</div>

您可能感兴趣的与本文相关的镜像

Yolo-v8.3

Yolo-v8.3

Yolo

YOLO(You Only Look Once)是一种流行的物体检测和图像分割模型,由华盛顿大学的Joseph Redmon 和Ali Farhadi 开发。 YOLO 于2015 年推出,因其高速和高精度而广受欢迎

def defineInputWin(self): inputFrame = LabelFrame(self.rootPage, text="Input Window") inputFrame.place(relx=0.01, relwidth=0.95, rely=0.01, relheight=0.2) def jenkins(): Config = LabelFrame(inputFrame, text="Jenkins Config") Config.place(relx=0.01, relwidth=0.32, rely=0.01, relheight=0.95) ID = Label(Config, text="projectID: ") ID.place(relx=0.01, relwidth=0.3, rely=0.01, relheight=0.3) idEntry = Entry(Config, textvariable=self.URL, state="normal") idEntry.place(relx=0.31, relwidth=0.2, rely=0.03, relheight=0.2) NAME = Label(Config, text="PipeLine:") NAME.place(relx=0.01, relwidth=0.3, rely=0.32, relheight=0.3) nameEntry = Entry(Config, textvariable=self.proName, state="normal") nameEntry.place(relx=0.31, relwidth=0.5, rely=0.36, relheight=0.2) version = Label(Config, text="BuildVersion: ") version.place(relx=0.01, relwidth=0.3, rely=0.63, relheight=0.3) versionEntry = Entry(Config, textvariable=self.version, state="normal") versionEntry.place(relx=0.31, relwidth=0.5, rely=0.63, relheight=0.2) def saveConfig(): api.Save_Config_File_Path("Jenkins Config", "projectId", self.version) api.Save_Config_File_Path("Jenkins Config", "projectId", self.URL) api.Save_Config_File_Path("Jenkins Config", "projectName", self.proName) save = Button(Config, text="保存配置", command=lambda: saveConfig()) save.place(relx=0.54, relwidth=0.18, rely=0.03, relheight=0.2) jenkins() def Debugger(): Config = LabelFrame(inputFrame, text="Debugger Config") Config.place(relx=0.34, relwidth=0.32, rely=0.01, relheight=0.95) def winIdea(): path = Label(Config, text="winIDEA Path: ") path.place(relx=0.01, relwidth=0.32, rely=0.03, relheight=0.2) pathEntry = Entry(Config, textvariable=self.winIdeaPath, state="normal") pathEntry.place(relx=0.32, relwidth=0.4, rely=0.03, relheight=0.2) pathBtn = Button(Config, text="选择路径", command=lambda: api.SelectPath("WinIDEA Config", "path", self.winIdeaPath)) pathBtn.place(relx=0.75, relwidth=0.2, rely=0.03, relheight=0.2) coreBtn = Checkbutton(Config, text="Core-0 Debug", variable=self.core, command="") coreBtn.place(relx=0.04, relwidth=0.32, rely=0.33, relheight=0.2) winIdea() Debugger() self.savePath = StringVar() self.readPath = StringVar() def other(): Config = LabelFrame(inputFrame, text="Other Config") Config.place(relx=0.67, relwidth=0.32, rely=0.01, relheight=0.95) canoePath = Label(Config, text="CANOE Path: ") canoePath.place(relx=0.01, relwidth=0.32, rely=0.03, relheight=0.2) pathEntry = Entry(Config, textvariable=self.canoePath, state="normal") pathEntry.place(relx=0.32, relwidth=0.4, rely=0.03, relheight=0.2) pathBtn = Button(Config, text="选择路径", command=lambda: api.SelectPath("Tool Config", "canoePath", self.canoePath)) pathBtn.place(relx=0.75, relwidth=0.2, rely=0.03, relheight=0.2) reportPath = Label(Config, text="Report Path: ") reportPath.place(relx=0.01, relwidth=0.32, rely=0.25, relheight=0.2) reportEntry = Entry(Config, textvariable=self.reportPath, state='normal') reportEntry.place(relx=0.32, relwidth=0.4, rely=0.25, relheight=0.2) reportBtn = Button(Config, text="选择路径", command=lambda: api.SelectPath("Tool Config", "reportPath", self.reportPath, isFile=False)) reportBtn.place(relx=0.75, relwidth=0.2, rely=0.25, relheight=0.2) other() 将上述代码转换成 pyqt6代码实现
09-30
使`label``input`在同一水平线有多种实现方法: - **使用浮动**:给`label`或`input`添加浮动属性,同时给父元素去除浮动以避免影响其他元素。示例代码如下: ```html <div class="chk-box"> <input id="all" type="checkbox"> <label style="min-width:50px" for="all">全选</label> </div> <style> #all { float: left; } /* 去除父元素浮动影响 */ .chk-box::after { content: ""; display: block; clear: both; } </style> ``` 这种方法通过浮动使元素在水平方向上排列,去除浮动可以防止对后续元素的布局产生影响 [^2]。 - **使用`vertical-align`属性**:给被对齐的元素添加`vertical-align`属性,可设置为`middle`(居中对齐)或`bottom`(底部对齐)。示例代码如下: ```html <div> <input class="form-input" type="checkbox"> <label style="vertical-align: middle;">全选</label> </div> ``` `vertical-align`属性定义行内元素的基线相对于该元素所在行的基线的垂直对齐 [^3]。 - **在 SAP UI5 应用中**:在使用`SimpleForm`时,其渲染出的 HTML 源代码会给`Label`控件分配整个屏幕宽度的 37%,`Input`控件分配 63% 的宽度,从而确保二者在同一行显示并占据整行宽度 [^1]。 - **在 Bootstrap 框架中**:使用`checkbox inline`类可以让多个`label``checkbox`组合显示在同一水平线上。示例代码如下: ```html <th align="left" valign="middle"> <label class="checkbox inline font-size"> <input type="checkbox" id="goods_server_name" name="goods_server_name[]" value=" 假一赔十 "> 假一赔十 </label> <label class="checkbox inline font-size"> <input type="checkbox" id="goods_server_name" name="goods_server_name[]" value=" 过期包换 "> 过期包换 </label> </th> ``` 通过这种方式可以方便地实现多个组合在水平方向上的排列 [^5]。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值