-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathattr.html
41 lines (41 loc) · 1.11 KB
/
attr.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="css/style.css">
<title>ATTR()</title>
<style>
a{
color: #222;
}
[pseudo-before]:before{
content: attr(pseudo-before);
margin-right: 8px;
}
[pseudo-after]:after{
content: attr(pseudo-after);
margin-left: 8px;
}
@media print {
[href]:after{
content: ' ('attr(href)')';
}
}
</style>
</head>
<body>
<ul>
<li pseudo-before="Icon">Exemplo de pseudo-before</li>
<li pseudo-after="Icon">Exemplo de pseudo-after</li>
<li><a id="link" href="https://www.meetup.com/">Veja o site do Meetup</a></li>
</ul>
<script>
link.addEventListener('click', (e) => {
e.preventDefault();
window.print();
});
</script>
</body>
</html>