1.) CSS or pure HTML cannot be used to initiate DOM actions. A manipulating language like JavaScript is always required for this purpose.
2.) To remove the buttons, you can override the current CSS and adjust the visibility or display properties to render them invisible or hidden (placeholding).
In order to trigger dynamic hiding and enable automatic sliding with intervals, JavaScript is essential.
Edit:
An example of animating the slider using CSS:
#container {
height: 200px;
width: 800px;
border: 1px solid #333;
overflow: hidden;
margin: 25px auto;
}
#box {
background: orange;
height: 180px;
width: 400px;
margin: 10px -400px;
-webkit-animation-name: move;
-webkit-animation-duration: 4s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: right;
-webkit-animation-timing-function: linear;
}
#box:hover {
-webkit-animation-play-state: paused;
}
@-webkit-keyframes move {
0% {
margin-left: -400px;
}
100% {
margin-left: 800px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8>
<title>HTML</title>
<link rel="stylesheet" href="main2.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="box">as</div>
</div>
</body>
</html>
Result
This snippet demonstrates the WebKit-only version. The equivalents for other browsers are as follows:
The keyframes for different browsers:
@-moz-keyframes move {
@-o-keyframes move {
@keyframes move {
For #box
, one property shown as an example:
-moz-animation-name: move;
-o-animation-name: move;
animation-name: move;