Skip to content

Instantly share code, notes, and snippets.

@jonahcoyote
Created January 23, 2019 17:34
Show Gist options
  • Save jonahcoyote/f879952b8899828aed8258ff333f7d6e to your computer and use it in GitHub Desktop.
Save jonahcoyote/f879952b8899828aed8258ff333f7d6e to your computer and use it in GitHub Desktop.
Divi Slider Module Auto Height
/* === Begin: Set the divi slider to auto height === */
/* Desktop */
.auto-height-slider .et_pb_slide .et_pb_container {
height: auto !important;
min-height: auto !important;
}
/* Tablet */
@media only screen and (min-width: 768px) and (max-width: 980px) {
.auto-height-slider .et_pb_slide .et_pb_container {
height: auto !important;
min-height: auto !important;
}
}
/* Phone */
@media only screen and (max-width: 767px) {
.auto-height-slider .et_pb_slide .et_pb_container {
height: auto !important;
min-height: auto !important;
}
.auto-height-slider .et-pb-controllers {
bottom: -1%;
}
}
/* Handle padding */
.auto-height-slider .et_pb_slide {
padding-bottom: 6% !important;
}
.auto-height-slider div.et_pb_slide_description,
.auto-height-slider .et_pb_slider_fullwidth_off div.et_pb_slide_description {
padding-top: 1%;
padding-bottom: 1%;
}
/* === End: Set divi slider height === */
@jonahcoyote
Copy link
Author

This CSS will make the Divi slider auto height by adding the "auto-height-slider" class to your slider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment