39 lines
1.1 KiB
HTML
39 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<title>Customization</title>
|
|
</head>
|
|
<body
|
|
class="bg-black sm:bg-green-800 md:bg-primary lg:bg-yellow-800 xl:bg-purple-800 2xl:bg-orange-800"
|
|
>
|
|
<h1 class="text-white text-xl md:text-3xl xl:text-5xl">
|
|
Tailwind is awesome
|
|
</h1>
|
|
|
|
<script>
|
|
function showBrowserWidth() {
|
|
const width =
|
|
window.innerWidth ||
|
|
document.documentElement.clientWidth ||
|
|
document.body.clientWidth
|
|
|
|
document.querySelector('h1').innerHTML = `Width: ${width}`
|
|
}
|
|
window.onload = showBrowserWidth
|
|
window.onresize = showBrowserWidth
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|
|
<!-- Breakpoint Classes
|
|
sm 640px @media (min-width: 640px) { ... }
|
|
md 768px @media (min-width: 768px) { ... }
|
|
lg 1024px @media (min-width: 1024px) { ... }
|
|
xl 1280px @media (min-width: 1280px) { ... }
|
|
2xl 1536px @media (min-width: 1536px) { ... }
|
|
-->
|