最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

不加 radio-inline也可以水平啊

<!DOCTYPE HTML>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>表單控件(復(fù)選框和單選按鈕水平排列)</title>

<link rel="stylesheet" >

</head>


<body>

<form role="form">

? ? <div class="form-group">

? ? <label class="radio-inline">

? ? ? ? <input type="radio" name="sex">男人

? ? ? ? </label>

? ? ? ? <label class="radio-inline">

? ? ? ? <input type="radio" name="sex">女人

? ? ? ? </label>

? ? ? ? <label class="radio-inline">

? ? ? ? <input type="radio" name="sex">中性

? ? ? ? </label>

? ? </div>

<div class="form-group">

? ? <label>

? ? ? ? <input type="checkbox" >男人

? ? ? ? </label>

? ? ? ? <label>

? ? ? ? <input type="checkbox" >女人

? ? ? ? </label>

? ? ? ? <label>

? ? ? ? <input type="checkbox" >中性

? ? ? ? </label>

? ? </div>

</form>

</body>

</html>


正在回答

2 回答

你沒(méi)有給label添加class="checkbox" 這樣把label默認(rèn)為類聯(lián)元素 所以能夠水平顯示 但是這樣不規(guī)范

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

無(wú)瑕疵 提問(wèn)者

非常感謝!
2016-08-19 回復(fù) 有任何疑惑可以回復(fù)我~

樓上回答的很正確,我來(lái)仔細(xì)分析一下,首先看源代碼

.radio,
.checkbox {
? position: relative;
? display: block;
? margin-top: 10px;
? margin-bottom: 10px;
}然后再看看

.radio input[type="radio"],
.radio-inline input[type="radio"],
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
? position: absolute;
? margin-top: 4px \9;
? margin-left: -20px;
}也就是說(shuō)默認(rèn)是內(nèi)聯(lián)元素,只有加上.radio,
.checkbox類時(shí)才是塊元素(也就是才換行)

3 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

不加 radio-inline也可以水平啊

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)