Bootstrap 4 navbar brand - is it possible to use a different logo at a smaller breakpoint?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have the following header logo that looks good in medium and larger sizes, but is inappropriate for smaller screens:

I can't use a responsive image, because, assuming I'm reading the documentation correctly, Bootstrap simply shrinks the width while leaving the height the same. I'm afraid the text would simply be unreadable as the width of the image is further and further constrained.
Ideally, I'd replace this logo with a smaller one at the medium break point. Is that possible?
html css bootstrap-4
add a comment |
I have the following header logo that looks good in medium and larger sizes, but is inappropriate for smaller screens:

I can't use a responsive image, because, assuming I'm reading the documentation correctly, Bootstrap simply shrinks the width while leaving the height the same. I'm afraid the text would simply be unreadable as the width of the image is further and further constrained.
Ideally, I'd replace this logo with a smaller one at the medium break point. Is that possible?
html css bootstrap-4
add a comment |
I have the following header logo that looks good in medium and larger sizes, but is inappropriate for smaller screens:

I can't use a responsive image, because, assuming I'm reading the documentation correctly, Bootstrap simply shrinks the width while leaving the height the same. I'm afraid the text would simply be unreadable as the width of the image is further and further constrained.
Ideally, I'd replace this logo with a smaller one at the medium break point. Is that possible?
html css bootstrap-4
I have the following header logo that looks good in medium and larger sizes, but is inappropriate for smaller screens:

I can't use a responsive image, because, assuming I'm reading the documentation correctly, Bootstrap simply shrinks the width while leaving the height the same. I'm afraid the text would simply be unreadable as the width of the image is further and further constrained.
Ideally, I'd replace this logo with a smaller one at the medium break point. Is that possible?
html css bootstrap-4
html css bootstrap-4
asked Nov 23 '18 at 18:59
Major ProductionsMajor Productions
3,031956125
3,031956125
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Perhaps not the most elegant but quick and easy: Have two brand images, hide and show as appropriate using Bootstrap utility display classes.
https://getbootstrap.com/docs/4.1/utilities/display/
Ex something like (I assume you're using .navbar-brand but the same technique works regardless):
<a class="navbar-brand" href="#">
<img src="logo-small.jpg" alt="Logo small" class="d-lg-none">
<img src="logo-large.jpg" alt="Logo large" class="d-none d-lg-block">
</a>
This would show the small logo at sizes xs, sm & md, and large logo at lg & xl.
3
You don't need thexldeclarations.d-lg-none(and up) is implicit. And yes, two links makes no sense as well. Just twoimgdeclarations
– Jonathan
Nov 23 '18 at 19:12
3
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53451774%2fbootstrap-4-navbar-brand-is-it-possible-to-use-a-different-logo-at-a-smaller-b%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Perhaps not the most elegant but quick and easy: Have two brand images, hide and show as appropriate using Bootstrap utility display classes.
https://getbootstrap.com/docs/4.1/utilities/display/
Ex something like (I assume you're using .navbar-brand but the same technique works regardless):
<a class="navbar-brand" href="#">
<img src="logo-small.jpg" alt="Logo small" class="d-lg-none">
<img src="logo-large.jpg" alt="Logo large" class="d-none d-lg-block">
</a>
This would show the small logo at sizes xs, sm & md, and large logo at lg & xl.
3
You don't need thexldeclarations.d-lg-none(and up) is implicit. And yes, two links makes no sense as well. Just twoimgdeclarations
– Jonathan
Nov 23 '18 at 19:12
3
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
add a comment |
Perhaps not the most elegant but quick and easy: Have two brand images, hide and show as appropriate using Bootstrap utility display classes.
https://getbootstrap.com/docs/4.1/utilities/display/
Ex something like (I assume you're using .navbar-brand but the same technique works regardless):
<a class="navbar-brand" href="#">
<img src="logo-small.jpg" alt="Logo small" class="d-lg-none">
<img src="logo-large.jpg" alt="Logo large" class="d-none d-lg-block">
</a>
This would show the small logo at sizes xs, sm & md, and large logo at lg & xl.
3
You don't need thexldeclarations.d-lg-none(and up) is implicit. And yes, two links makes no sense as well. Just twoimgdeclarations
– Jonathan
Nov 23 '18 at 19:12
3
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
add a comment |
Perhaps not the most elegant but quick and easy: Have two brand images, hide and show as appropriate using Bootstrap utility display classes.
https://getbootstrap.com/docs/4.1/utilities/display/
Ex something like (I assume you're using .navbar-brand but the same technique works regardless):
<a class="navbar-brand" href="#">
<img src="logo-small.jpg" alt="Logo small" class="d-lg-none">
<img src="logo-large.jpg" alt="Logo large" class="d-none d-lg-block">
</a>
This would show the small logo at sizes xs, sm & md, and large logo at lg & xl.
Perhaps not the most elegant but quick and easy: Have two brand images, hide and show as appropriate using Bootstrap utility display classes.
https://getbootstrap.com/docs/4.1/utilities/display/
Ex something like (I assume you're using .navbar-brand but the same technique works regardless):
<a class="navbar-brand" href="#">
<img src="logo-small.jpg" alt="Logo small" class="d-lg-none">
<img src="logo-large.jpg" alt="Logo large" class="d-none d-lg-block">
</a>
This would show the small logo at sizes xs, sm & md, and large logo at lg & xl.
edited Nov 23 '18 at 19:16
answered Nov 23 '18 at 19:09
emmzeeemmzee
340311
340311
3
You don't need thexldeclarations.d-lg-none(and up) is implicit. And yes, two links makes no sense as well. Just twoimgdeclarations
– Jonathan
Nov 23 '18 at 19:12
3
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
add a comment |
3
You don't need thexldeclarations.d-lg-none(and up) is implicit. And yes, two links makes no sense as well. Just twoimgdeclarations
– Jonathan
Nov 23 '18 at 19:12
3
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
3
3
You don't need the
xl declarations. d-lg-none (and up) is implicit. And yes, two links makes no sense as well. Just two img declarations– Jonathan
Nov 23 '18 at 19:12
You don't need the
xl declarations. d-lg-none (and up) is implicit. And yes, two links makes no sense as well. Just two img declarations– Jonathan
Nov 23 '18 at 19:12
3
3
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Also don't need two links afaik.
– Havenard
Nov 23 '18 at 19:12
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
Thanks for those tips, I was apparently trying to go too fast :)
– emmzee
Nov 23 '18 at 19:16
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53451774%2fbootstrap-4-navbar-brand-is-it-possible-to-use-a-different-logo-at-a-smaller-b%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown