update css next prev button

This commit is contained in:
veerjot_dm 2025-01-10 15:16:23 +05:30
parent 676b8aa711
commit 282024ad7e
3 changed files with 21 additions and 4 deletions

2
.gitignore vendored
View file

@ -5,7 +5,7 @@
/node_modules
/.pnp
.pnp.js
/JsonData
../src/JsonData
# testing
/coverage

View file

@ -23,10 +23,11 @@ const Slider = () => {
},[]);
return (
<div className="container">
<div className="left-btn">
<button onClick={handlePre}>{"<"}</button>
</div>
<img src={data[next]?.download_url} alt="img1"></img>
<img src={data[next]?.download_url} alt="image-not-found"></img>
<div className="right-btn">
<button onClick={handleNext}>{">"}</button>
</div>

View file

@ -13,16 +13,32 @@ code {
}
img{
width: 100%;
height: 500px;
height:auto;
}
.left-btn, .right-btn{
position: absolute;
top: 50%;
transform: translateY(300%);
}
.left-btn{
left: 20px;
}
.right-btn{
right: 20px;
}
}
button{
height: 20px;
width: 30px;
background-color: rgba(0, 0, 0, 0);
color: black;
border: none;
font-size: 125%;
}
button:hover{
color: white;
}
@media (max-width: 768px) {
.left-btn, .right-btn { top: 40%; }
}