Skip to content

Commit 7a1a820

Browse files
committed
Add styles to image caption (cotes2020#144)
1 parent 8179f5f commit 7a1a820

2 files changed

Lines changed: 28 additions & 11 deletions

File tree

_posts/2019-08-08-text-and-typography.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,22 @@ Fluttering and dancing in the breeze.
7777
Click the hook will locate the footnote[^footnote].
7878

7979

80-
## Image
80+
## Images
81+
82+
By default, the image is centered and the image caption can be displayed at the bottom:
8183

8284
![Desktop View](/assets/img/sample/mockup.png)
85+
_Full screen width and center alignment_
86+
87+
You can change the size of the picture:
88+
89+
![Desktop View](/assets/img/sample/mockup.png){: width="400"}
90+
_400px image width_
91+
92+
In addition, you can use custom styles to change the image position (do not use caption in this case):
93+
94+
![Desktop View](/assets/img/sample/mockup.png){: width="200" style="float: left; margin: .75rem 1rem 1rem 0"}
95+
_A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space._
8396

8497

8598
## Inline code

assets/css/_addon/main.scss

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,6 @@ $sidebar-display: "sidebar-display";
461461
#post-wrapper {
462462
min-height: calc(100vh - #{$topbar-height}
463463
- #{$footer-height} - #{$post-extend-min-height})!important;
464-
.post-content {
465-
a:hover {
466-
@extend %link-hover;
467-
}
468-
}
469464
}
470465

471466
#topbar-wrapper.row,
@@ -795,7 +790,6 @@ div.post-content .table-wrapper {
795790
}
796791

797792

798-
799793
/*--- post ---*/
800794

801795
.pageviews .fa-spinner {
@@ -832,11 +826,21 @@ div.post-content .table-wrapper {
832826
p {
833827
font-size: 1.08rem;
834828
> img {
835-
margin-top: .5rem;
836-
margin-bottom: 1.5rem;
837-
@include align-center;
829+
&:not([style]) {
830+
margin: .5rem 0;
831+
@include align-center;
832+
+ em {
833+
display: block;
834+
text-align: center;
835+
font-style: normal;
836+
font-size: 80%;
837+
padding: 0;
838+
margin-top: .7rem;
839+
color: #6d6c6c;
840+
}
841+
}
838842
}
839-
}
843+
}// p
840844
}
841845

842846
.tag:hover {

0 commit comments

Comments
 (0)