+ 1
How to make a simple carousel in CSS or Javascript
I would like to make a very simple carousel with some image for a school project, but I don't event know where to start. I may try with the <table> HTML tag but that doesn't sense to me... Have you guys have some example or idea?
2 Respostas
+ 1
You can try to use @keyframes animation in CSS for that!
For instance:
index.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<img src="Horse.png" alt="Horse" id="horse">
</body>
</html>
style.css
@keyframes horsemove{
0%{
margin-top:10%;
margin-left:10%;
}
10%{
margin-top:20%;
margin-left:0%;
}
/*etc etc... Make the margin attributes on your own!*/
}
#horse{
animation:horsemove 3s linear infinite;
}
+ 3
Signor Gatto you can simple use bootstrap https://getbootstrap.com/docs/4.6/components/carousel/