-
-
Save xdesro/35e153ca60958834ac2520f52c28d5e1 to your computer and use it in GitHub Desktop.
You can apparently use CSS :has() to read meta tags of a page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta name="description" content="This is a test."> | |
<style> | |
head:has(meta[content^="This is a test."]) + body div:before { | |
content: "The description of this page is 'This is a test.'"; | |
} | |
</style> | |
</head> | |
<body> | |
<div></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment