Change the Header Width
Support Area › Forums › Elite › Change the Header Width
- This topic has 11 replies, 2 voices, and was last updated 9 years, 8 months ago by Bill Robbins.
-
AuthorPosts
-
August 19, 2014 at 10:51 #21717glen hearndenParticipant
Want to change the header ‘width’, to approx 70%, so it does not go full width of page. (running from just to left of logo block and right of menu bar). Got it transparent behind the logo and menu, but want to slim down width if possible.
Is there a snippet of CSS you can give to do this, that I can add into Custom CSS box?
Have gone through forum as hate to think its asking for repeat info, but not found this specifically.
Thanks in advance – your site and theme is great – your support is amazing – thanks.
August 19, 2014 at 12:14 #21720Bill RobbinsModeratorHello Glen,
I appreciate your business. Good question too. You can change the width of the header. There are two boxes that make up the header. There is one called #header that spans the full width of the browser window. There is another one inside it called #header-content. It’s smaller and centered in the middle of the browser window. It contains the logo and navigation bar. Here’s how you can adjust it’s width:
- Go to your theme options page and choose the Advanced tab.
- Scroll down to the Custom CSS box and add this:
#header-content { width: 70%; } @media only screen and (min-width: 1024px) and (max-width: 1200px) { #header-content { width: 70%; } }
- Update your settings.
Let me know if that doesn’t get you to where you’re wanting to go.
Thanks,
BillAugust 20, 2014 at 04:24 #21730glen hearndenParticipantNope – afraid not quite there with this one!
This code doesn’t seem to affect in anyway??
Attached screen shot with markers for what we want to achieve, just the opaque panel behind logo and menu to be adjusted to less than full width of page, but still behind logo and menu…any ideas?
Thanks in advance.
August 20, 2014 at 09:35 #21739Bill RobbinsModeratorThank you for sending over the link. That helped out tremendously. When you mentioned making the header transparent, I was picturing it being completely clear and it was just a matter of adjusting the width of the content area. Seeing it now, I understand what you’re shooting for. Remove all of this:
body.gallery #header { background-color: rgba(0, 0, 0, 0.5); } body.image #header { background-color: rgba(0, 0, 0, 0.5); } #header-content { width: 70%; } @media only screen and (min-width: 1024px) and (max-width: 1200px) { #header-content { width: 70%; }
#header-content { padding-left: 30px; padding-right: 30px; background-color: rgba(0,0,0,0.5); }
See if that doesn’t get to where you want to go. You can adjust the padding on the left and right to change the amount of background that appears on either side of the logo and menu.
Bill
August 22, 2014 at 03:56 #21802glen hearndenParticipantHi,
Sounds like a great fix and it does resize the width either end as you would hope, but this code makes the ‘depth’ of the header opaque bar reduce, want to keep same depth if possible… sure this is simple, but your coded snippets are invaluable in getting it right. Thanks in advance.
August 22, 2014 at 06:03 #21804Bill RobbinsModeratorGood Morning Glen,
We can likely change that. When you say depth, what specifically do you mean? Let me know and we’ll go from there.
Thanks,
BillAugust 22, 2014 at 07:41 #21806glen hearndenParticipantSorry had my 3D head on!
The height seems to adjust down to approx half height when I use your latest code snippet… width adjusts and looks great, but the height shrinks too! which is not good. Screen snap attached to show reduced opacity area with new CSS code.
Hope that is clearer.
Attachments:
August 22, 2014 at 09:20 #21811Bill RobbinsModeratorThe content area of the header has a height of 70 pixels set. You can remove that if you’d like to and let the size of the logo image dictate the size of the header. This CSS snippet should do that for you:
#header-content { height: auto; }
Let me know how that goes,
BillAugust 22, 2014 at 09:41 #21812glen hearndenParticipantI think we are getting there – this now does what is needed with the header block, but affects the menu drop down. It is pushed down out of reach from the main menu, if you try to reach it, it disappears before you can get mouse over!
Screen shot attached.
Any ideas or have I worn you out on a Friday! ThanksAttachments:
August 22, 2014 at 10:05 #21816Bill RobbinsModeratorAlmost there. The trouble with drop-downs is one of the reasons the header has a fixed height. When it varies the placement of the drop-down has to be changed in order to remain workable. See if this won’t do the trick:
nav#top-menu ul li:hover ul { margin-top: -80px; }
If you change your logo height, you’ll need to adjust that margin to keep the drop downs in position.
Let me know if you need anything else,
BillAugust 26, 2014 at 05:02 #21924glen hearndenParticipantResolution gratefully received – seems to look fine now. Thanks again for your help and patience.
August 26, 2014 at 06:01 #21928Bill RobbinsModeratorAnytime Glen. Have a gret day!
-
AuthorPosts
- The topic ‘Change the Header Width’ is closed to new replies.