In this media query example, we will use a list of names which function as email links:
HTML file: | Displayed by browser: |
---|---|
<style>
ul { list-style-type: none; } ul li a { color: green; text-decoration: none; padding: 3px; display: block; } </style> <body> <ul> <li><a data-email="[email protected]" href="mailto:[email protected]">John Doe</a></li> <li><a data-email="[email protected]" href="mailto:[email protected]">Mary Moe</a></li> <li><a data-email="[email protected]" href="mailto:[email protected]">Amanda Panda</a></li> </ul> </body> |
Notice the data-email attribute. In HTML5, we can use attributes prefixed with data- to store information.