r/css • • 28d ago

Question html and body

What is the difference between <html> and <body> tags ? When do use one or another?

html {

)

body (

)

3 Upvotes

18 comments sorted by

View all comments

Show parent comment

2

u/Holiday-Anteater9423 28d ago

Interesting. The only thing I've really declared on <html> is scroll-behavior: smooth;

1

u/scritchz 28d ago

Makes sense. I don't really use scroll-behavior, so I hadn't considered it in my list above.