Skip to content

Commit fae7b8c

Browse files
author
Blundell
committed
scale image on display size
1 parent e26b294 commit fae7b8c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

enews/enews-java/html-generator/src/main/java/com/novoda/enews/HtmlGenerator.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,14 @@ void makeList() {
3535
li().style("list-style-type: none; margin: 0; padding: 10px; overflow: auto;")
3636
.a().style("text-decoration: none; color: black;").href(article.getPageLink())
3737
.div()
38-
.img()
39-
.style("float: left; margin: 0 15px 0 0; width: 100px; height: 100px;" +
40-
" object-fit: cover;" +
41-
" border-radius: 6px; background-color: #fafafa; padding: 10px;")
42-
.src(article.getImage())
38+
.div()
39+
.style("max-width: 100px")
40+
.img()
41+
.style("float: left; margin: 0 15px 0 0; max-width: 100%; width: auto; height: auto;" +
42+
" object-fit: cover;" +
43+
" border-radius: 6px; background-color: #fafafa; padding: 10px;")
44+
.src(article.getImage())
45+
.end()
4346
.end()
4447
.p()
4548
.style("font: bold 20px/1.5 Helvetica, Verdana, sans-serif; color: #2d2d2d;")

0 commit comments

Comments
 (0)