Website Design Scale -
H1-h6
This is heading 1
This is heading 2
This is heading 3
This is heading 4
This is heading 5
This is heading 6
p,span,div
This is Div Tag
This is Span Tag
This is Paragrapgh Tag
Font Scaling Table -
Element | Mobile Size / Line Height |
Tablet Size / Line Height |
Desktop Size / Line Height |
Font Weight | Font Family |
---|---|---|---|---|---|
h1 | 32px / 38.4px | 40px / 48px | 48px / 57.6px | 700 | Lato |
h2 | 28px / 36.4px | 36px / 46.8px | 40px / 52px | 600 | Lato |
h3 | 24px / 32.4px | 30px / 40.5px | 32px / 43.2px | 600 | Lato |
h4 | 20px / 28px | 24px / 33.6px | 28px / 39.2px | 500 | Lato |
h5 | 18px / 26.1px | 20px / 29px | 24px / 34.8px | 500 | Lato |
h6 | 16px / 24px | 18px / 27px | 20px / 30px | 500 | Lato |
p | 16px / 25.6px | 400 | Inter | ||
span | 16px / inherit | 400 | Inter | ||
div | 16px / inherit | 400 | Inter | ||
small | 14px / 21px | 400 | Inter |
Font Scaling another Formula -
📐 Responsive Font Scaling with clamp()
– Tailwind Style
How it works:
This CSS uses the
The root
This CSS uses the
clamp(min, preferred, max)
function to make font sizes adjust fluidly between screen sizes. This approach mimics Tailwind's font scaling but with pure CSS.The root
html
font size is made responsive, and all text elements (like p
, h1
–h6
, span
, etc.) scale automatically based on that.
/* Base font size formula using clamp:
clamp(min, scaling formula, max)
Example: clamp(16px, 1vw + 1rem, 20px)
*/
html {
font-size: clamp(16px, 1vw + 0.5rem, 20px);
}
/* Body and global elements */
body,
p,
span,
a,
div,
li,
label,
input,
button,
textarea {
font-size: 1rem; /* 1rem is now fluid because of html clamp */
line-height: 1.6;
}
/* Headings with scalable formulas */
h1 {
font-size: clamp(2.5rem, 6vw + 1rem, 4.5rem);
line-height: 1.2;
}
h2 {
font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
line-height: 1.25;
}
h3 {
font-size: clamp(1.75rem, 4vw + 1rem, 3rem);
line-height: 1.3;
}
h4 {
font-size: clamp(1.5rem, 3vw + 1rem, 2.5rem);
line-height: 1.35;
}
h5 {
font-size: clamp(1.25rem, 2.5vw + 1rem, 2rem);
line-height: 1.4;
}
h6 {
font-size: clamp(1rem, 2vw + 0.5rem, 1.5rem);
line-height: 1.5;
}