diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-04-29 11:45:06 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-04-29 13:27:02 +0200 |
| commit | 9db0fd7fd6a09969c3f3a0018599cef9e12b4ba9 (patch) | |
| tree | 409afcabb9d7cb6cc71762ccc9933fa5ef29b2d2 | |
| parent | 184e3a3f92295fad81460ca13f9e845a2a5ff74a (diff) | |
| download | rust-9db0fd7fd6a09969c3f3a0018599cef9e12b4ba9.tar.gz rust-9db0fd7fd6a09969c3f3a0018599cef9e12b4ba9.zip | |
Fix image position and display
| -rw-r--r-- | src/librustdoc/html/layout.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 26 |
2 files changed, 22 insertions, 10 deletions
diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 7176abc3db8..ae0bd1aafa8 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -183,15 +183,13 @@ pub fn render<T: fmt::Display, S: fmt::Display>( if layout.logo.is_empty() { format!("<a href='{path}index.html'>\ <div class='logo-container'>\ - <img src='{static_root_path}rust-logo{suffix}.png' \ - alt='logo' width='100'></div></a>", + <img src='{static_root_path}rust-logo{suffix}.png' alt='logo'></div></a>", path=p, static_root_path=static_root_path, suffix=page.resource_suffix) } else { format!("<a href='{}index.html'>\ - <div class='logo-container'>\ - <img src='{}' alt='logo' width='100'></div></a>", + <div class='logo-container'><img src='{}' alt='logo'></div></a>", p, layout.logo) } diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 66236d7cb45..f9d00cad717 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -183,16 +183,24 @@ nav.sub { } .logo-container { - height: 0; - padding-bottom: 50%; -} - -.sidebar img { + height: 100px; + width: 100px; + position: relative; margin: 20px auto; display: block; 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 { border: 1px solid; font-size: 17px; @@ -1035,14 +1043,20 @@ span.since { padding: 0; } - .sidebar img { + .sidebar .logo-container { width: 35px; + height: 35px; margin-top: 5px; margin-bottom: 5px; float: left; margin-left: 50px; } + .sidebar .logo-container > img { + max-width: 35px; + max-height: 35px; + } + .sidebar-menu { position: fixed; z-index: 10; |
