一、结构伪类选择器

  1. <style>
  2. .catelist{
  3. margin: 20px;
  4. }
  5. /* 结构伪类选择器 */
  6. .item:nth-of-type(2){
  7. color: red;
  8. }
  9. .item:nth-of-type(2n){
  10. background-color: rgb(227, 227, 227);
  11. }
  12. .item:nth-last-of-type(1){
  13. color: blue;
  14. }
  15. .item:nth-last-of-type(3){
  16. color: rgb(15, 241, 15);
  17. }
  18. </style>
  19. <ol class="catelist">
  20. <li class="item">item1</li>
  21. <li class="item">item2</li>
  22. <li class="item">item3</li>
  23. <li class="item">item4</li>
  24. <li class="item">item5</li>
  25. <li class="item">item6</li>
  26. <li class="item">item7</li>
  27. <li class="item">item8</li>
  28. </ol>

二、状态伪类选择器

  1. <style>
  2. /* 状态伪类选择器 */
  3. input:focus{
  4. background-color: aquamarine;
  5. border: 1px dashed gray;
  6. }
  7. input:disabled{
  8. color: red;
  9. border: none;
  10. }
  11. button{
  12. width: 150px;
  13. height: 30px;
  14. border: none;
  15. margin-bottom: 10px;
  16. background-color: greenyellow;
  17. }
  18. button:hover{
  19. background-color: red;
  20. cursor: pointer;
  21. color: #fff;;
  22. }
  23. </style>
  24. <div class="regist">
  25. <form action="check.php" method="post">
  26. <fieldset>
  27. <legend>用户注册</legend>
  28. <label>用户名:<input type="text" /></label>
  29. <label>
  30. 性别:<input type="radio" name="sex" value="1" checked />
  31. <input type="radio" name="sex" value="0" />
  32. </label>
  33. <label>
  34. 警告:<input type="text" value="一旦注册不可修改" disabled />
  35. </label>
  36. <button>提 交</button>
  37. </fieldset>
  38. </form>
  39. </div>

更多相关文章

  1. Android基础教程(一)--Android工程目录结构
  2. CSS伪类,状态伪类和结构性伪类
  3. 2022年0707结构伪类与状态伪类与盒模型常用属性
  4. (三)Android(安卓)项目在Eclipse中的目录结构
  5. android之wifi开发(一)
  6. Android(安卓)listview checkbox 再次进入activity 保留checkbox
  7. android--系统体系结构
  8. android 源码总体结构
  9. android:shape的使用

随机推荐

  1. Android 各种机型兼容问题
  2. Android: Runtime.exec()的陷阱
  3. Android(安卓)开发中的  AsyncTask 的
  4. android中比较两张图片的相似度
  5. Adding prebuilt shared library to Andr
  6. android 启动报错
  7. android 日历组件(CalendarView)
  8. 2019博客汇总
  9. System Permissions—— android系统权限
  10. PC和Android(安卓)adb通信