文字輸入框不一定只能單色。透過 CSS 的 background-image,可以讓 textarea 或 input 出現底紋、提示圖或品牌 Logo。
.bg {
background-image: url(bgdemo2.jpg);
background-repeat: no-repeat;
background-position: center center;
}
如果背景圖只是裝飾,建議保持低對比,避免影響輸入內容的可讀性。若要放 Logo,可搭配 background-position 與適當的 padding,讓文字與圖形不互相干擾。