1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 02:48:11 +00:00
serenity/Base/home/anon/www/attrselectors.html
Andreas Kling 61ba19f031 LibHTML: Handle stand-alone attribute selectors
A selector like "[foo]" is now parsed as a universal selector component
with an attribute match type. Pretty neat :^)
2019-11-21 20:19:00 +01:00

24 lines
704 B
HTML

<html>
<head>
<title>CSS attribute selector test</title>
<style type="text/css">
[hello=friends] {
background-color: #f0f;
color: white;
}
div[id="foo"] {
background-color: blue;
color: #fff;
}
div[cool] {
background-color: green;
color: #ffffff;
}
</style>
</head>
<body>
<div hello=friends>This div is hello, friends!</div>
<div id="foo">This div has id="foo" and is bloo!</div>
<div cool="">This div has a "cool" attribute and a cool green color.</div>
</body>
</html>