Home >Web Front-end >CSS Tutorial >How to create a pure css slider

How to create a pure css slider

王林
王林forward
2020-07-21 17:37:373348browse

How to create a pure css slider

You can use the max-height property to create a pure CSS slider.

(Recommended tutorial: css quick start)

Attribute introduction:

max-height attribute sets the maximum height of the element. The max-height attribute does not include padding, borders, or margins!

Code implementation:

.slider {
  max-height: 200px;
  overflow-y: hidden;
  width: 300px;
}

.slider:hover {
  max-height: 600px;
  overflow-y: scroll;
}

The above is the detailed content of How to create a pure css slider. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete