Change Background Image for screen size using CSS and tailwind CSS | Coder Shubham

preview_player
Показать описание
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Change Background on Screen Size Change</title>
</head>
<body>
<style>
*{
margin: 0;
}
#img{
margin: 25vh auto;
border-radius: 50px;
width: 80vw;
height: 50vh;
background-size: cover;
}
/* Main Code here */
/* You can change these parameters as per your need and if you want to do the same thing in tailwind css then youcan use media classes there like: xl:bg-[url('url')] */
@media screen and (max-width: 768px){
#img{
}
}
@media screen and (max-width: 480px){
#img{
}
}
</style>
<div id="img"></div>
</body>
</html>

Open find and replace and replace
< with smaller than symbol and
> with greater than symbol
Рекомендации по теме
Комментарии
Автор

bro in i want it with next js 13.4 and tailwind..
So how it would be?

jabedalamakash