三、字体相关
字体设置简写
font: style weight size family;(要按顺序设置)
font:normal 500 80px “楷体”
文本样式
color:red; 颜色(#000 黑色 #fff 白色 #f00 红色 #0f0 绿色 #00f 蓝色)
text-align:left; 文本排列(left right center 居中)
text-indent:20px; 首行缩进(直接给一个值)
line-height:30px; 文本行高
text-decoration:none; 文本装饰(默认值none没有线 underline 下划线 overline 上划线 line-through 给文本中间加一条线贯穿)
width 标签宽度
height 标签高度
想文本在标签垂直居中 text-height=height
用户不能选择文本
p{ user-select:none }
下拉框
<select name=”first-select” id=”select” size=”10”>(size更改下拉框大小)
<option value=”苹果”selected >苹果</option> (默认被选中 用selected value要填内容 提交的内容是value填写的内容)
</ select>
文本域
< textarea name=”” id=”” cols=”10” rows=”2”placeholder=“q请输入文本”>
(cols 和 rows 是以字符为单位)
placeholder="请输入文本" (默认提示)
设置文本域样式
<style>
textarea {
resize:none;
} 不可以被选中
</style>
图片文本的对齐方式
vertical-align:middle 文字图片居中(通过设置图片进行与文字对齐 bottom下方(默认值) top 上方)