Solved

bootstrap and logo placements

Posted on 2014-11-18
12
536 Views
Last Modified: 2014-11-22
Hello again

This is a continuation of a previous question I asked yesterday. Still getting my head wrapped around bootstrap, so this is probably an easy one, I hope :)

Right now, on my page, I'm trying to get my logo to move over to the left a bit more (between 75-100 pixels more I'm guessing). If I add

margin-left: -100px;

to the main image class, it moves it over, but then gets real jumpy whenever I resize the browser window. Ideally, I'd like to just have the logo jump up into the left side of the nav bar when the nav bar collapses and becomes a dropdown.

any advice is greatly appreciated!

Cheers
Josh
0
Comment
Question by:Big Monty
  • 6
  • 5
12 Comments
 
LVL 19

Expert Comment

by:Manoj Patil
ID: 40452050
Hi,
Can you please explain more.
Is this you want...?
Is this correct location of the logo ?
0
 
LVL 32

Author Comment

by:Big Monty
ID: 40452605
not quite. what I want to do is when the view port is roughly that size, and the menu items collapse down into the drop down menu in the top right, i want to shrink the logo down and put it in the same row as where the collapsible menu appears, all the way to the left side of that white space.
0
 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 40456325
I would do the following:
1. Hide your primary logo at the same break point where the nav collapses
do this by updating the  div that wraps arund the logo from class="col-lg-3 pull-left xtLogo"  to class="col-lg-3 pull-left xtLogo hidden-xs"
The hidden-xs will do the work for you
2. Add a a second logo here
<div class="container">    
  <!-- logo that will only be visible when the primary logo is not -->  
  <img src="img/logo.png" class="pull-left brand">              
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">

Open in new window


3. Add a new style that controls the new logo
img.pull-left.brand {
max-height: 60px;
margin-top: 10px;
margin-bottom: 10px;
display:none
}

Open in new window


4. Write a new media query that shows the second logo at the exact moment the prmary logo hides.
@media (min-width: 768px)
.img.pull-left.brand  {
display: block;
}

Open in new window

This will do what you need
0
 
LVL 32

Author Comment

by:Big Monty
ID: 40456572
doesn't look like it's worked...can you take a look and see if I missed anything?
0
 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 40456625
Everything is almost there.
Update the media query I gave you to
@media (max-width: 768px){
.img.pull-left.brand  {
display: block
}}

Open in new window

Make sure you include all of the curly brackets show in my snippet.
Also make sure its at the bottom of your style sheet.
Tested it and it works perfectly..
Cheers,
N
0
 
LVL 32

Author Comment

by:Big Monty
ID: 40457531
i tried the new code and it hides the big logo, but doesn't show the one in the whitespace at the top of the page
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 40457889
The media query tells the smaller logo to appear at the 768px break point.
Check to make sure that the media query comes at the very end of your css as the code set up works perfectly on my local system.
N
0
 
LVL 5

Accepted Solution

by:
Neil_Bradley earned 500 total points
ID: 40457898
Spotted the typo. You need to remove the dot from img.
Updated media query
@media (max-width: 768px){
img.pull-left.brand  {
display: block
}}

Open in new window

N
0
 
LVL 32

Author Comment

by:Big Monty
ID: 40459840
perfect, that does it!

the only thing I noticed is when I resized my browser, the white box on the right side sometimes jumped down the page, then back up. it seems to happen around the 950px wide mark, any ideas why and should I really concern myself with it?
0
 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 40459883
i would ask you to open up an new question as the original question has been answered.
Cheers,
n
0
 
LVL 32

Author Comment

by:Big Monty
ID: 40459928
Sure no problem. I'm not even going to worry about it right now. Thx again for all of your help again!
0
 
LVL 5

Expert Comment

by:Neil_Bradley
ID: 40459955
Pleased to help out
N
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding a Li to a UL after a specified Li contents 2 42
Javascript Hashmap output 8 44
HTML Relative path 9 29
bootstrap footer centering and expand problems 7 17
This article discusses four methods for overlaying images in a container on a web page
Find out what you should include to make the best professional email signature for your organization.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now