【发布时间】:2021-12-21 02:33:55
【问题描述】:
我想在每个输入的右侧添加注释。这里是 example 我用引导布局创建的。
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div>
<section class="content container-fluid">
<form id="submitForm">
<fieldset>
<br>
<div class="form-group row">
<label for="userId" class="col-sm-1 col-form-label">User</label>
<div class="col-sm-6">
<select class="form-control" id="userId">
<option value="1">Alex</option>
<option value="39">Kent</option>
<option value="6">Nick</option>
</select>
</div>
<div class="col-sm-5, small" style="padding-left: 18px">
If your name is not available, please contact the Officer.
</div>
</div>
<div class="form-group row">
<label for="purposeNames" class="col-md-1 col-form-label">Purpose</label>
<div class="col-sm-6">
<input type="text" id="purposeNames" class="form-control" placeholder="Purpose" />
</div>
<div class="col-sm-5" style="padding-left: 18px">
<div class="row">
<div class="col-sm-12, small">
Feel free to select more than one purpose per ticket e.g. email + instant messaging. Such purpose combinations will only proportionally affect purpose statistics. Please do not use online time that was initially requested for purposes of the category
"Not affecting personal quota" (e.g. chores) also for checking personal emails, instant messaging etc. Instead, request separate internet access by selecting the desired purpose category e.g. email; instant messaging etc.
</div>
</div>
</div>
</div>
<div class="form-group row">
<label for="userPassword" class="col-sm-1 col-form-label">Password</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="userPassword" placeholder="Password">
</div>
<div class="col-sm-5, small" style="padding-left: 18px">
Please use combination of letter, symbol & number.
</div>
</div>
</fieldset>
</form>
</section>
</div>
</body>
问题是当屏幕宽度减小时,多行的行无法正常运行。例如:
1.标签(目的)位置已更改:
2。没有文字填充:
更新:
发现1.标签(目的)位置改变问题是由于目的标签的col-md-1。应该使用 col-sm 代替。这是修改后的版本:
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<div>
<section class="content container-fluid">
<form id="submitForm">
<fieldset>
<br>
<div class="form-group row">
<label for="userId" class="col-sm-1 col-form-label">User</label>
<div class="col-sm-6">
<select class="form-control" id="userId">
<option value="1">Alex</option>
<option value="39">Kent</option>
<option value="6">Nick</option>
</select>
</div>
<div class="col-sm-5 small" style="padding-left: 3px">
If your name is not available, please contact the Officer.
</div>
</div>
<div class="form-group row">
<label for="purposeNames" class="col-sm-1 col-form-label">Purpose</label>
<div class="col-sm-6">
<input type="text" id="purposeNames" class="form-control" placeholder="Purpose" />
</div>
<div class="col-sm-5 small" style="padding-left: 3px">
Feel free to select more than one purpose per ticket e.g. email + instant messaging. Such purpose combinations will only proportionally affect purpose statistics. Please do not use online time that was initially requested for purposes of the category
"Not affecting personal quota" (e.g. chores) also for checking personal emails, instant messaging etc. Instead, request separate internet access by selecting the desired purpose category e.g. email; instant messaging etc.
</div>
</div>
<div class="form-group row">
<label for="userPassword" class="col-sm-1 col-form-label">Password</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="userPassword" placeholder="Password">
</div>
<div class="col-sm-5 small" style="padding-left: 3px">
Please use combination of letter, symbol & number.
</div>
</div>
</fieldset>
</form>
</section>
</div>
</body>
现在剩下的唯一问题是文本填充。 padding-left 3px 全屏时很好,但屏幕缩小时不行:
【问题讨论】:
标签: html css twitter-bootstrap