css3中user-select的用法详解

html-css014

css3中user-select的用法详解,第1张

user-select属性是css3新增的属性,用于设置用户是否能够选中文本。可用于除替换元素外的所有元素,以下是user-select的主要用法和注意事项的说明,更多信息可参考如下css3文档说明。

参考资料:

https://www.cnblogs.com/10manongit/p/12913477.html

css设置下拉列表(select)样式首先我们需要获取到这个元素的id或者是class,然后在通过给这个元素设置它的width和height等等一些样式,具体的看代码:

<html>

<head>

<style>

.div1{

width:600px

height:200px

font-size:13px

}

.div select{

width:200px

}

.div select option{

width:150px

height:30px

}

</head>

<body>

<div class='div1'>

<select>

<option value="volvo">Volvo</option>

<option value="saab">Saab</option>

<option value="opel">Opel</option>

<option value="audi">Audi</option>

</select>

</div>

</body>

</html>