---
title: "Webkit的textarea输入框"
author: "luolonghao"
date: "2010-05-24T12:21:10Z"
tags: []
categories: ["Web前端"]
slug: "webkit-textarea"
draft: false
lastmod: "2010-05-24T12:21:10Z"
id: 673774
url: "https://luolonghao.iteye.com/blog/673774"
---

大家都知道，Webkit系列浏览器（Safari、Chrome）的textarea的默认效果和其它浏览器不一样，比如，textarea可拖动调整大小，聚焦（onfocus）时边框变成黄色。这些效果的确很酷，但我们有时候不需要这些效果，那怎么办呢？其实用CSS轻松取消这些效果。

1. 取消拖动调整大小

```css

textarea {
    resize: none;
}

```


2. 聚焦时边框颜色不变

```css

textarea:focus {
    outline: none;
}

```