1
Fork 0

Fix image position and display

This commit is contained in:
Guillaume Gomez 2019-04-29 11:45:06 +02:00
parent 184e3a3f92
commit 9db0fd7fd6
2 changed files with 22 additions and 10 deletions

View file

@ -183,15 +183,13 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
if layout.logo.is_empty() { if layout.logo.is_empty() {
format!("<a href='{path}index.html'>\ format!("<a href='{path}index.html'>\
<div class='logo-container'>\ <div class='logo-container'>\
<img src='{static_root_path}rust-logo{suffix}.png' \ <img src='{static_root_path}rust-logo{suffix}.png' alt='logo'></div></a>",
alt='logo' width='100'></div></a>",
path=p, path=p,
static_root_path=static_root_path, static_root_path=static_root_path,
suffix=page.resource_suffix) suffix=page.resource_suffix)
} else { } else {
format!("<a href='{}index.html'>\ format!("<a href='{}index.html'>\
<div class='logo-container'>\ <div class='logo-container'><img src='{}' alt='logo'></div></a>",
<img src='{}' alt='logo' width='100'></div></a>",
p, p,
layout.logo) layout.logo)
} }

View file

@ -183,16 +183,24 @@ nav.sub {
} }
.logo-container { .logo-container {
height: 0; height: 100px;
padding-bottom: 50%; width: 100px;
} position: relative;
.sidebar img {
margin: 20px auto; margin: 20px auto;
display: block; display: block;
margin-top: 10px; margin-top: 10px;
} }
.logo-container > img {
max-width: 100px;
max-height: 100px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: block;
}
.sidebar .location { .sidebar .location {
border: 1px solid; border: 1px solid;
font-size: 17px; font-size: 17px;
@ -1035,14 +1043,20 @@ span.since {
padding: 0; padding: 0;
} }
.sidebar img { .sidebar .logo-container {
width: 35px; width: 35px;
height: 35px;
margin-top: 5px; margin-top: 5px;
margin-bottom: 5px; margin-bottom: 5px;
float: left; float: left;
margin-left: 50px; margin-left: 50px;
} }
.sidebar .logo-container > img {
max-width: 35px;
max-height: 35px;
}
.sidebar-menu { .sidebar-menu {
position: fixed; position: fixed;
z-index: 10; z-index: 10;