Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5d1f2ae

Browse files
committed
Set a fixed height for sphinx gallery images
... so that lazy loading does not change heights. Without a fixed height lazy loading of images interferes with anchor links: Clicking a link goes to a certain position, but then the loaded images add content and move the anchor to a different position.
1 parent 67acbfa commit 5d1f2ae

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/_static/mpl.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ html[data-theme="dark"] .sphx-glr-thumbcontainer {
8585
background-color: rgb(63, 63, 63);
8686
}
8787

88+
/* Set a fixed height so that lazy loading does not change heights. Without a fixed
89+
* height lazy loading of images interferes with anchor links: Clicking a link goes to
90+
* a certain position, but then the loaded images add content and move the anchor to a
91+
* different position.
92+
*/
93+
.sphx-glr-thumbcontainer img {
94+
height: 112px;
95+
}
96+
8897
/* hide download buttons in example headers
8998
* https://sphinx-gallery.github.io/stable/advanced.html#hide-the-download-buttons-in-the-example-headers
9099
*/

0 commit comments

Comments
 (0)