chiark / gitweb /
css: fix clickable .m-image.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Sep 2017 14:18:29 +0000 (16:18 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 14 Sep 2017 22:11:11 +0000 (00:11 +0200)
The bottom margin was not applied because of the outer <a> element,
moreover the <a> element was spanning the whole page width instead of
just the image. A fix requires additional outer <div> now.

css/m-components.css

index ead162c50e54c7c24e2734cf15159e712b3baeec..e39d1180e558532fab1ece9681bb06b3bba15601 100644 (file)
@@ -755,14 +755,24 @@ table.m-table tr.m-dim th, table.m-table th.m-dim {
   color: var(--dim-link-active-color);
 }
 
-/* Image, figure */
+/* Image */
 img.m-image {
   display: block;
-  max-width: 100%;
   margin-left: auto;
   margin-right: auto;
+}
+div.m-image {
+  text-align: center;
+}
+img.m-image, div.m-image img {
+  max-width: 100%;
   border-radius: 0.2rem;
 }
+div.m-image.m-fullwidth img {
+  width: 100%;
+}
+
+/* Figure */
 figure.m-figure {
   max-width: 100%;
   margin-top: 0;
@@ -1001,14 +1011,16 @@ div.highlight pre span.hll {
 p, ul, ol, dl, blockquote, hr, pre,
 article, article > header, article section,
 .m-note, .m-frame, .m-block,
-div.m-scroll, table.m-table, img.m-image, figure.m-figure, .m-imagegrid {
+div.m-scroll, table.m-table, div.m-image, img.m-image,
+figure.m-figure, .m-imagegrid {
   margin-bottom: 1rem;
 }
 p:last-child, ul:last-child, ol:last-child, dl:last-child, blockquote:last-child, hr:last-child,
 div.highligt:last-child pre, /* TODO: get rid of div.highlight */
 article:last-child, article section:last-child,
 .m-note:last-child, .m-frame:last-child, .m-block:last-child,
-table.m-table:last-child, img.m-image:last-child, figure.m-figure:last-child {
+table.m-table:last-child, img.m-image:last-child, div.m-image:last-child,
+figure.m-figure:last-child, .m-imagegrid:last-child {
   margin-bottom: 0;
 }