我正在使用 Kendo UI 编写网页。页面的一部分看起来像这样
<input class="k-radio" id="cwnight" type="radio" name="cw" value="night" />
<label class="k-radio-label" for="cwnight">夜潮</label>
<span>时间</span>
<input id="opentime" />
和JS脚本
$(document).ready(function () {
$("#opentime").kendoDatePicker({
//change: onChangestart,
culture: "zh-Hans"
});
});
“夜潮”和后面的“时间”怎么对齐?
最佳答案
请尝试使用以下代码片段。
方法一:-
<head>
.........
.........
<style>
.verticalAlignMiddle {
vertical-align: middle;
}
</style>
</head>
<body>
<input class="k-radio" id="cwnight" type="radio" name="cw" value="night" />
<label class="k-radio-label" for="cwnight">夜潮</label>
<span class="verticalAlignMiddle">时间</span>
<input type="text" />
.........
.........
</body>
方法二:-
<head>
.........
.........
<style>
span {
vertical-align: middle;
}
</style>
</head>
<body>
<input class="k-radio" id="cwnight" type="radio" name="cw" value="night" />
<label class="k-radio-label" for="cwnight">夜潮</label>
<span class="verticalAlignMiddle">时间</span>
<input type="text" />
.........
.........
</body>
关于javascript - 如何将 <label> 和普通文本与 Kendo UI 对齐?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35597031/