直接使用css的標簽選擇器就可以實現(xiàn)

成都創(chuàng)新互聯(lián)公司專注于巫溪網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗。 熱誠為您提供巫溪營銷型網(wǎng)站建設(shè),巫溪網(wǎng)站制作、巫溪網(wǎng)頁設(shè)計、巫溪網(wǎng)站官網(wǎng)定制、小程序開發(fā)服務(wù),打造巫溪網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供巫溪網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。
td?input[type='text']?{.../*設(shè)置需要的樣式*/}
舉個例子:
創(chuàng)建Html元素
table
tr
tdname/td
tdinput?type="text"/td
tdsex/td
tdinput?type="radio"?name="sex"?checked男input?type="radio"?name="sex"女/td
/tr
tr
tdtel./td
tdinput?type="text"/td
tdaddr./td
tdinput?type="text"/td
/tr
/table
設(shè)置css樣式
table{border-collapse:?collapse;}
td{border:1px?solid?#ccc;padding:5px;}
/*設(shè)置單元格中文本框的樣式*/
td?input[type='text']{border:1px?solid?green;border-radius:3px;height:30px;}
觀察顯示效果
需要說明:input[type="text"]?這種寫法不支持IE,但支持Firefox。
可以這樣寫:
style
input?{
color:?#FFF;
}
!--針對IE的--
input?{
color:expression(this.type=="text"??red:"style");
}
!--針對IE以外的--
input[type="text"]?{
color:?red;
}
/style
可以給標簽家個id或class; 就可以調(diào)整文本框的寬和高。
如:
style type="text/css"
.text1{width:100px; height:20px}
/style
input type="text" class="text1" /
擴展資料:
在CSS中,使用text-align屬性控制文本的水平方向的對齊方式:左對齊、居中對齊、右對齊。
該屬性通過指定行框與哪個點對齊,從而設(shè)置塊級元素內(nèi)文本的水平對齊方式。通過允許用戶代理調(diào)整行內(nèi)容中字母和字之間的間隔,可以支持值 justify;不同用戶代理可能會得到不同的結(jié)果。
默認值:left if direction is ltr, and right if direction is rtl?
繼承:yes?
版本:CSS1?
JavaScript 語法:object.style.textAlign="right"?
參考資料來源:百度百科-text-align
head
style type="text/css"
!--
.aa
{ background-color:#0000ff; color:#000000;filter: alpha(opacity=50)}
.bb
{ background-color:#009933; color:#000000;
}
/script/head加入這個
body
div id="Layer5" onMouseOver="this.className='aa'" onMouseOut="this.className='bb'"/div
/body這樣鼠標經(jīng)過顏色就變啦
網(wǎng)頁題目:css設(shè)置文本框樣式,css文本輸入框樣式
轉(zhuǎn)載來源:http://chinadenli.net/article37/dsicspj.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站改版、搜索引擎優(yōu)化、微信小程序、靜態(tài)網(wǎng)站、網(wǎng)站策劃
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)