首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

CSS3的before, after跟label的for用法

2012-10-31 
CSS3的before, after和label的for用法使用before和after可以用content, 结合before, after可做写入内容和

CSS3的before, after和label的for用法
使用before和after可以用content, 结合before, after可做写入内容和样式

看例子:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title><style type="text/css">.before{width: 100px;height:100px;border: 1px solid blue;}.before::before{content:'bef';width: 20px;height: 20px;background-color:red;}.before::after{content:'aft';width: 20px;height: 20px;background-color:blue;}</style></head><body><input id='input1' type='radio'/><div class="before"></div><label for='input1'>点击我</label></body></html>

热点排行