1、使用CSS 设置文本样式有哪些?

html-css012

1、使用CSS 设置文本样式有哪些?,第1张

1、使用CSS 设置文本样式有:color、letter-spacing、line-height、text-align、text-decoration、word-spacing

2、使用CSS 设置背景颜色的标签background-color,背景图片的标签:background

3、使用CSS 设置的其他元素有哪些?margin、padding、position等

直接使用css的标签选择器就可以实现

td input[type='text'] {.../*设置需要的样式*/}

举个例子:

创建Html元素

<table>

<tr>

<td>name</td>

<td><input type="text"></td>

<td>sex</td>

<td><input type="radio" name="sex" checked>男<input type="radio" name="sex">女</td>

</tr>

<tr>

<td>tel.</td>

<td><input type="text"></td>

<td>addr.</td>

<td><input type="text"></td>

</tr>

</table

设置css样式

table{border-collapse: collapse}

td{border:1px solid #cccpadding:5px}

/*设置单元格中文本框的样式*/

td input[type='text']{border:1px solid greenborder-radius:3pxheight:30px}

观察显示效果