Subscribe Today! ► https://goo.gl/Y3wTy5
This tutorial shows how to change the CSS that sets the height of the top level navigation bar in the Gantry 5 Hydrogen template.
Once you know what CSS changes you need to make you will need to put those same changes on your live site. The following tutorial will help you with that step:
I found out that since brackets are not allowed in YouTube descriptions, I could not post the CSS I said I would share during the video - sorry!
In order to find the CSS that we're going to change to adjust the height of that navigation bar, we're going to be using Google Chrome's element examiner. So, I have the Basic Joomla site opened up here with the Gantry 5 template, with Hydrogen template, and I'm going to hit F12 to bring up the element inspector.
What we want to do is click on this button here on the left to select an element and we're going to select somewhere up here on that menu bar. That's probably a good guess there since its selecting the whole thing and we'll look down - now we have the elements on this side and what their properties are.
Now, as I look over on the left-hand side here in this code you'll see that there's a number of other options in the hierarchy here and I want to just keep highlighting till I get to the element that still is at the top and select what we want. This one "g-container" it goes right across the top but I don't see anything in here setting the same color that is there, so I go up one higher to "g-navigation" to the section. That still highlights right across and when I look over here I see here's the background color that is set. So this is probably the CSS that we want to change. So I'm going to type by just clicking here to add a new line to the CSS to test it and type "height", hit enter and then I'm going to type 40 and we'll do 40 pixels (PX). And we'll see right away, as soon as I finish typing the X, this top bar has the height that is lower.
So the next thing that we want to do, though, is we need to find some other CSS to change because as you can see the white of the home menu there is a different height as well. So first of all, before moving on I'm going to left click and select this HTML because you're going to want to put that in our custom HTML page in the Rockettheme template. I'm going to copy that and we'll put it over here on another screen - I just have a notepad open - and here I'm just going to paste that CSS there and we'll get ready for a new line to paste the next things.
Alright, so the next thing that we want to do is somehow change the height of this white. So what I'm going to do is I'm going to go slowly down through the HTML levels here until only that white is highlighted. I might actually get the point where I run out but here this arrow you see we can click and go to the next level. We'll highlight that - there we go we've got it. That's the active menu. So, when we click on that, look over here and we'll see here the background white color is being set there for "g-navigation, g-main nav top-level" so once again I’m going to type in there "height". We're going to add a new line - let's do the same height of course, 40 pixels, and now that white has changed in its height - so we're making progress. Again, I'm going to select all that CSS, that we've just edited, we actually don't need to repeat the background color so what we'll do is I'll bring my notepad over here and we'll paste that in there. But I'm going to take out this background color line and just delete it. We have some weird double spacing happening here but that won't affect when we paste later on.
Alright, next you notice that the title "Home" is now right on the very bottom it's not at the middle of the white spot there. So, let's go down another level over on the left and select - there we go we have the "ag menu item container". We click on that and now we're looking for something that will make that whole move up and as we scroll down here we see "g main nav top level padding" Now this check check box here, we can just uncheck that and see if that has any effect on what we're working on and it does, so we're in the right area and we want to adjust this first number to remove the padding that's at the top so it can move up a bit. I've already been experimenting with this, so we're going to go and put in ".45 REM" and as we change it we see that it's centered nicely up there. So, again down here we'll just hit enter and once again we have some CSS we want to select and copy and put in our list of CSS that we've edited.
And of course the final step is to take all of this custom CSS code that we've made changes to and paste that into the "custom.scss" file.
Tutorial Theme Song "Bluewater" courtesy of http://www.freestockmusic.com
Looping Background "Teal Tiles" courtesy of http://www.motionbackgroundsforfree.com