Improve the image style.

This commit is contained in:
Cotes Chung 2020-09-02 18:25:57 +08:00
parent d78f034f5d
commit 9dcab7ac1f
3 changed files with 18 additions and 20 deletions

View file

@ -734,6 +734,10 @@ a {
} // a } // a
img {
max-width: 100%;
}
.post { .post {
h1 { h1 {
margin-top: 3rem; margin-top: 3rem;
@ -823,20 +827,14 @@ div.post-content .table-wrapper {
} }
p { p {
font-size: 1.08rem; font-size: 1.08rem;
} > img {
img { margin-top: .5rem;
max-width: 100%; margin-bottom: 1.5rem;
margin-top: .5rem; @include align-center;
margin-bottom: 1.5rem; }
position: relative;
left: 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
} }
} }
.tag:hover { .tag:hover {
@extend %tag-hover; @extend %tag-hover;
} }

View file

@ -98,3 +98,11 @@
font-weight: $font-weight; font-weight: $font-weight;
font-family: 'Roboto Condensed', 'Microsoft Yahei', sans-serif; font-family: 'Roboto Condensed', 'Microsoft Yahei', sans-serif;
} }
@mixin align-center {
position: relative;
left: 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}

View file

@ -45,6 +45,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
.post-preview-img { .post-preview-img {
margin-top: 0; margin-top: 0;
margin-bottom: 2.5rem; margin-bottom: 2.5rem;
@include align-center;
} }
} }
@ -341,19 +342,10 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
/* Hide SideBar and TOC */ /* Hide SideBar and TOC */
@media all and (max-width: 830px) { @media all and (max-width: 830px) {
.post img {
position: relative;
left: 50%;
-webkit-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
}
.post-navigation { .post-navigation {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
margin-left: -.5rem; margin-left: -.5rem;
margin-right: -.5rem; margin-right: -.5rem;
} }
} }