How to use interactive elements in html5

php中世界最好的语言
Release: 2017-11-23 16:00:58
Original
1953 people have browsed it

In H5, interactive elements are elements that interact with users. This part is very important, and unlike the previous JS control effect, H5 adds a lot of interactive elements compared to HTML, such as hiding and displaying footnotes. One of the interactive effects.

<!DOCTYPE html>
<html>
<head>
       <meta charset="UTF-8">
       <title>交互元素<details>的使用</title>
       <style type="text/css">
              body{
                     font-size: 12px;
              }
              span{
                     font-weight: bold;
              }
              details{
                     overflow: hidden;
                     height: 0;
                     padding-left: 200px;
                     position: relative;
                     display: block;
              }
              details[open]{
                     height: auto;
              }
       </style>
</head>
<body>
       <span>隐藏脚注</span>
       <details open="open">
              本页面生成于 2016-010-21
       </details>
       <!--<span>显示注脚</span>
       本页面生成于 2016-010-21
       <details open="open">
       </details>
-->
</body>
</html>
Copy after login

There are so many ways to use interactive elements in html5. I believe you have learned a lot after our introduction. For more exciting content, please pay attention to other related articles on the php Chinese website!

Related reading:

Why do we need to set CSS styles for DIV?

How to use the HTML5

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!