All you need is 58 bytes of CSS to look great nearly everywhere

Today I received the following notification and a link to a demo site that only needs 58 bytes of CSS script…

when making this website, i wanted a simple, reasonable way to make it look good on most displays. not counting any minimization techniques, the following 58 bytes worked well for me:

main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}

https://jrl.ninja/etc/1/?utm_source=DigitalOcean_Newsletter

Simple is usually best most of the time:).

Of course if all you have is text to display then all you need is a max-width and suitable padding anyway.

However the html used in that demo isn’t very semantic.

e.g. h1 followed by h3 and a main element wrapping the whole page as well as an article element wrapper. The body element could have been used for the max-width and save using the main element incorrectly as a page wrapper.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.