Responsive design
2022-12-31 html css tailwind responsive youtubeNotes about Tailwind responsive features and how to build web site working nicely on all screen sizes from this video:
- there is five breakpoints:
sm
(640px),md
(768px),lg
(1024px),xl
(1280px),2xl
(1536px). max-w-md
andmx-auto
classes for centered block with specified maximum width- the prefix can specify the class would apply when we are over the breakpoint size
- utilities
h
andw
for height and width object-cover
andobject-center
to keep aspect ratio of the image and cover parts of image outside boundaries- idea to duplicate some contents and make it
hidden
on some breakpoints - using
grid
withgrid-cols-2
to set image next to the text. When using more columns,col-span-nn
can put the block over multiple columns - nice way to visualize blocks using
bg-color-nnn
, especially in combination with breakpoints. Color palette <br>
elements can behidden
It is good to see thinking and workflow on how to define the layout for various screen sizes.