Blogger Information
Blog 11
fans 0
comment 0
visits 6703
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Ement常用语法总结
向日葵
Original
470 people have browsed it

今天整理了一下Ement的一些常用语法,下面进行列举,活不多说,直接上代码:

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <title>1221homework</title>
  8. </head>
  9. <body>
  10. <!--1. 实例演示Ement常用语法
  11. 2. 实例演示元素四类属性
  12. 3. 实例演示布局标签,并分析div+class与 html5语义化标签的优缺点-->
  13. <!-- 1.实例演示Ement常用语法 -->
  14. <!-- 父子关系:> -->
  15. <!--p>input.name{请输入姓名}-->
  16. <p><input type="text" class="name">请输入姓名</input></p>
  17. <!-- p>input#password{请输入密码} -->
  18. <p><input type="password" id="password">请输入密码</input></p>
  19. <!-- 兄弟关系:+ -->
  20. <!-- p+button.commit{提交} -->
  21. <p></p>
  22. <button class="commit" onclick="alert('提交成功')">提交</button>
  23. <!-- 向上一级:^ -->
  24. <!-- div>img.img[src=http://img95.699pic.com/photo/50167/4554.jpg_wh300.jpg!/fh/300/quality/90]^p -->
  25. <div><img src="http://img95.699pic.com/photo/50167/4554.jpg_wh300.jpg!/fh/300/quality/90" alt="" class="img"></div>
  26. <p></p>
  27. <!-- 重复:* -->
  28. <!-- ul>li*5{demo$} -->
  29. <ul>
  30. <li>demo1</li>
  31. <li>demo2</li>
  32. <li>demo3</li>
  33. <li>demo4</li>
  34. <li>demo5</li>
  35. </ul>
  36. <!-- ul.goods>li.class$*3>a[href="https://php.cn/"]{商品$} -->
  37. <ul class="goods">
  38. <li class="class2"><a href="https://php.cn/">商品2</a></li>
  39. <li class="class3"><a href="https://php.cn/">商品3</a></li>
  40. <li class="class1"><a href="https://php.cn/">商品1</a></li>
  41. </ul>
  42. <br/>
  43. <!-- ul.goods1>li.item$*5>a[href="https://php.cn/"]{课程$@1221} -->
  44. <ul class="goods1">
  45. <li class="item1"><a href="https://php.cn/">课程1221</a></li>
  46. <li class="item2"><a href="https://php.cn/">课程1222</a></li>
  47. <li class="item3"><a href="https://php.cn/">课程1223</a></li>
  48. <li class="item4"><a href="https://php.cn/">课程1224</a></li>
  49. <li class="item5"><a href="https://php.cn/">课程1225</a></li>
  50. </ul>
  51. <style>
  52. .goods{
  53. color:aquamarine;
  54. background-color: rgb(196, 226, 167);
  55. }
  56. </style>
  57. <!-- 画一个3*5的表格 -->
  58. <table border="1">
  59. <tr>
  60. <td>AAA</td>
  61. <td>AAA</td>
  62. <td>AAA</td>
  63. <td>AAA</td>
  64. <td>AAA</td>
  65. </tr>
  66. <tr>
  67. <td>AAA</td>
  68. <td>AAA</td>
  69. <td>AAA</td>
  70. <td>AAA</td>
  71. <td>AAA</td>
  72. </tr>
  73. <tr>
  74. <td>AAA</td>
  75. <td>AAA</td>
  76. <td>AAA</td>
  77. <td>AAA</td>
  78. <td>AAA</td>
  79. </tr>
  80. </table>
  81. <!-- 1.通用属性 id,class,style -->
  82. <div class="class">测试class属性</div>
  83. <div id="id">测试id属性</div>
  84. <div style="color: brown;">测试style属性</div>
  85. <!-- 2.预设属性: href... -->
  86. <a href="http://php.cn/">测试a标签的预设属性</a>
  87. <img src="http://pic171.huitu.com/pic/20211027/774808_20211027220017955070_0.jpg" alt="" class="img">测试图片的预设属性</img>
  88. <!-- 3.事件属性:on事件(onclick等) -->
  89. <button onclick="alert('提交成功')">提交</button>
  90. <div>
  91. <input type="text" oninput="this.nextElementSibling.textContent=this.value">
  92. <p>实时显示输入内容</p>
  93. </div>
  94. <!-- 4.自定义属性 -->
  95. <div data-email="my@163.com">用户信息</div>
  96. <button onclick="this.nextElementSibling.textContent=this.previousElementSibling.dataset.email">获取用户邮箱</button>
  97. <p>这里显示用户邮箱</p>
  98. <!--为什么大多数程序员更喜欢使用通用标签?
  99. 1、现在大多数项目基于移动端,不依赖或不在乎搜索引擎
  100. 2、语义化标签是有限的,而用class自定义字符串去描述的属性更多样,更自由一点。
  101. 3、语义化标签并没有被淘汰,可以混合使用。 -->
  102. </body>
  103. </html>
Correcting teacher:autoloadautoload

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post