Created
August 30, 2022 18:34
-
-
Save dalthonmh/0c9e2d0fc68e6598ce8fff69c6720ff9 to your computer and use it in GitHub Desktop.
Tailwindcss background linear gradient image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Tailwindcss background linear gradient image | |
* "tailwindcss": "^3.1.8" | |
* dalthonmh | |
*/ | |
function MyCard({ grupo }) { | |
const { number, name, numberOfPrograms, image, color } = grupo; | |
return ( | |
<div | |
className="w-full h-96 bg-no-repeat bg-cover relative rounded-lg" | |
style={{ | |
backgroundImage: `linear-gradient(0deg, rgba(0,0,0,0.8), rgba(255,255,255,0.2)), url('${image}')`, | |
}} | |
> | |
<div className="h-full w-full text-white"> | |
<div className="absolute bottom-4 ml-4 text-left"> | |
<div | |
className="w-24 text-center text-white text-sm mb-2" | |
style={{ backgroundColor: color }} | |
> | |
{`GRUPO ${number}`} | |
</div> | |
<p className="text-white">{name}</p> | |
<p className="text-gray-300">{numberOfPrograms}</p> | |
</div> | |
</div> | |
</div> | |
); | |
} | |
export default MyCard; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment