2012-11-24 114 views
0

所以我想做出看起來像這樣的文本字段:自定義圖像邊界

enter image description here

可以調整作爲文本是這樣

前以某種方式或長或短; enter image description hereenter image description here

這裏是我得到了部分enter image description hereenter image description hereenter image description here

那麼,有沒有簡單的方法來使與CSS?

+1

爲什麼不能簡單地用CSS'border'和'背景color'(也可能是'箱shadow'和'邊境radius')和節省「背景圖像」拼圖的煩惱嗎? –

+0

如果我使用盒子陰影,它不會在Internet Explorer中正常工作,對吧? – user1826795

+0

http://stackoverflow.com/questions/8181699/box-shadow-in-ie7-and-ie8 – MikeSmithDev

回答

0

<style> 


.class_name{border: 1px solid white;-moz-border-radius:19px; 
-webkit-border-radius: 19px; 
border-radius:5px; 
-moz-box-shadow: 0px 0px 5px #666; 
-webkit-box-shadow: 0px 0px 5px #666; 
box-shadow: 0px 0px 5px #666; 
padding:2px 10px; 
text-align:center; 
width:70px; height:auto; 
margin:0px auto;} 
</style> 

HTML代碼

<div class="class_name">sample</div> 
+0

我想OP會嘗試輸入一些東西,用戶可以輸入。 –