Tailwind gives you small utility classes like p-4 or text-center to build your own design. Bootstrap provides ready-made components like buttons and navbars with fixed styles.
In Tailwind, p-4 means padding with the 4th step in the spacing scale, which equals 1rem by default.
Tailwind uses prefixes like sm: to apply styles at specific breakpoints, making it easy to write responsive styles inline. Bootstrap uses grid classes like col-md-6 to control layout per screen size.
Bootstrap's pre-built components include accessibility features like ARIA roles and keyboard support. Tailwind provides styling utilities but leaves accessibility implementation to the developer.
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Click Me</button>
What color will the button background be when the mouse is NOT hovering over it?
bg- without the hover: prefix.The class bg-blue-500 sets the background to a medium blue color. The hover:bg-blue-700 changes it to a darker blue only on hover.