App下載
話題 首頁(yè) > CSS3 教程 > CSS3 教程話題列表 > 詳情

如何利用CSS3打造無(wú)圖片圓角輸入框?

精華
宇文傻姑 2016-11-28 19:23:15 瀏覽(5416) 回復(fù)(6) 贊(0)
誰(shuí)知道如何實(shí)現(xiàn)無(wú)圖片的圓角輸入框嗎?好煩惱??!
css3

回答(6)

施主同西否 精華 2016-11-28

如何實(shí)現(xiàn)無(wú)圖片的圓角輸入框這問(wèn)題沒(méi)什么好煩惱的,其實(shí)利用css3新添加的radius屬性 就可以輕松的解決這個(gè)問(wèn)題。代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>W3Cschool圓角輸入框</title>
<style>
input {
    background:#fff; border: 1px solid #000;
    padding:5px;
    border-radius:5px;
    -webkit-border-radius:5px;
    -moz-border-radius:5px;
}
</style>
</head>
<body>
<input
class="inout"
name="inout"
type="text"
value="W3Cschool圓角矩形輸入框">
</body>
</html>

PS:

-moz(例如上面代碼中的: -moz-border-radius:5px; 是firefoe的專(zhuān)有屬性; )用于Firefox
-webkit(例如上面代碼中的:-webkit-border-radius:5px;  是chrome和safari的專(zhuān)有屬性;)用于Safari和Chrome。
當(dāng)然,萬(wàn)惡的IE6是不支持這個(gè)屬性的。

input{border- radius :5px;}

后面的值要看具體情況基本5像素就能出現(xiàn)圓角,但是ie低版本不支持

一筆荒蕪 2018-05-31

好慢呀,空空如也,半天不來(lái)大神解決,大佬在哪啦

1144100656 2018-05-31

剛學(xué)習(xí)程序,過(guò)來(lái)學(xué)習(xí)學(xué)習(xí)!!!!...

1152696398 2018-05-31

這個(gè)問(wèn)題我也不清楚,等大佬來(lái)解決吧。。

海海520 2018-07-04

input{border- radius :5px;}

要回復(fù),請(qǐng)先登錄 或者注冊(cè)