Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Bootstrap Yii navigation overlaps logo when shrinking browser just before it switches to the next smaller responsive size

Posted on 2016-08-18
8
Medium Priority
?
133 Views
Last Modified: 2016-08-19
Hello all,
    I am having an issue with one of our new websites we have made. I have experience with PHP / HTML / MySQL, but this was from many years ago before responsive web / bootstrap and when development frameworks were just getting started, and my knowledge of CSS is fairly limited. Our site is made using the YII framework and a bootstrap theme. I know enough to make some basic edits to information, and even took something a 3rd party did to our site and emulated it to make a new page for a form that users can submit. I am not quite sure where or how to edit the site for the issue that I am having though.

    Looking at the "responsive.css" I found that you can edit the threshold in pixels of where it will switch from one "screen size preset" (for lack of knowing the actual term) to another with the following.

 
@media (min-width: 992px) and (max-width: 1199px)

Open in new window


Though I was told that editing those presets could / would mess with how it could end up looking on tablets or other typical mobile screen sizes, so my question is, what and where do I edit to fix the issue in the below image?

(Image is a gif, so you will probably have to click it to view the animation)
Example of navigation / image overlap
As you can see, when I shrink the browser, there is overlap of the "Shop All" button with the main logo before the site changes layouts. What is the best way to fix this? Is there a way to set the navigation to only move so far to the left to avoid that, or do I edit the point in which it changes to the next layout, to happen just before the overlap occurs?

Thanks all!
0
Comment
Question by:MostHated
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 10

Assisted Solution

by:Prasadh Baapaat
Prasadh Baapaat earned 2000 total points
ID: 41761240
Yes you can fix this with setting up your own MEDIA QUERIES as they are called ... (@media (min-width: 992px) is a media query

1) now you will have to use some easy tools to check what is the range of pixels when the overlap happens.

2) set a media query to address it.

It would be very good if you can post the actual site link so I can take a look at it and give appropriate solution.

if not then you will have to use Chrome browser and in it there is a built in tool which shows the code + screen size. it is called the "inspect" tool.

open site in Chrome and then right click and select "inspect" which is last option in menu.

the site will look like the screenshot and then you can see at what exact pixels the overlapping starts as you resize the browser window.

inspect tool chrome
then you set media query accordingly to affect That particular range of screen size.

let me know if you were able to get it right.

thanks,
Prasadh
0
 
LVL 1

Author Comment

by:MostHated
ID: 41762428
Thanks for the reply Prasadh, the site is as follows : http://bryantparkbelts.com. I tried to adjust the media query pixel, but I could not make it work correctly, it just ended up making things out of wack a bit, such as, the text for smaller for the navigation before the break actually happened that would cause the nav to go below the logo.

Are you saying that I can / should add an additional media query in there?
0
 
LVL 10

Expert Comment

by:Prasadh Baapaat
ID: 41762520
Ok, now I will check the site and get back to you... pls give me some time.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Accepted Solution

by:
Prasadh Baapaat earned 2000 total points
ID: 41762659
I checked your site, and in the header there are 2 divs..> #main-header & #main-menu

INSIDE the #main-menu, the div #logo is placed inside a 2 column div (col-md-2)

and then there is the navbar in another div... but it does not have any column specification ... so it occupies the whole row.

so now here it is a tricky situation applying the media query... BTW the overlap happens between width or 1260px and 990px

I suggest if we remove the logo OUTSIDE the navbar by giving the navbar a column width of 10 columns like:

<div class="col-md-10 collapse navbar-collapse navbar-cat-collapse">

Open in new window


note that I have just added "col-md-10"

can you try this by making a test page? if yes, then lets go ahead and check the outcome.

thanks,
Prasadh
0
 
LVL 1

Author Comment

by:MostHated
ID: 41762743
Thank you for the great reply, I tried to add what you had mentioned, but unfortunately it did not seem to resolve the issue. One thing I did notice though when I was looking at the developer console of chrome, the div around the logo was smaller than the actual size of the image width.

When I changed that by adding style="width:200px:" to the div just outside of the div id=logo, it fixed where it would overlap, but now the menu for some reason is staying too far to the left and not moving over toward the middle when making the screen large again.

Edit, I just tried doing "col-md-10 col-md-offset-1 collapse navbar-collapse navbar-cat-collapse" and I believe that might have fixed it! Let me try it out again. It seems to be a bit too far to the right now, lol. I can not seem to win.
0
 
LVL 10

Assisted Solution

by:Prasadh Baapaat
Prasadh Baapaat earned 2000 total points
ID: 41762753
That is because the menu has a property of "float: left" like in code below:

.navbar-nav {
    float: left;
    margin: 0;
}

Open in new window


try removing that float and lets see what happens. the code is in Bootstrap, so we will have to OVERRIDE it...

Paste this code in a CSS file which loads AFTER bootstrap

.navbar-nav {
    float: none !important;
    margin: 0;
}

Open in new window


keep me posted...
0
 
LVL 1

Author Comment

by:MostHated
ID: 41762775
Ok swell, looks like I have it just the way I like it! Thank you so much for your help!
0
 
LVL 10

Expert Comment

by:Prasadh Baapaat
ID: 41762810
Great :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

721 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