Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Single menu background not full width


  #1  
Old Mar 25, 2018, 01:43 PM
Paul Gingell
 
10 posts · Nov 2012
England
Hi. I'm remaking an website I built with Atahualpa about 4 years ago and trying to make use of some of the responsive mods suggested on this forum since then. I'm having trouble with the menu background.

I'm trying to set a background which spans all the menu items but doesn't span the full width of the site.

If I target the CSS at div#menu1 ul.rMenu li I get an individual background for each menu item (which doesn't look right because my design uses an inset box shadow around the menu as a whole, not the individual menu items).

Instead, I've used div#menu1 ul.rMenu, but it spans the full width of the layout, unless I set a limiting width value (which causes problems on mobile devices, if fall back fonts are a different size, etc.)

Website: www.cumbria-stone-walling.co.uk

Current CSS:
Code:
div#menu1 ul.rMenu {
	background-color: rgba(135, 135, 135, 0.25) !important;
	-webkit-box-shadow: 0 0 50px rgba(0, 0, 0, 0.25) inset;
	-moz-box-shadow: 0 0 50px rgba(0, 0, 0, 0.25) inset;
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.25) inset;
	-moz-border-radius: 4px; 
	-khtml-border-radius: 4px; 
	-webkit-border-radius: 4px; 
	border-radius: 4px;
	width: 385px;
	height: 40px;
	margin-top: -6px;
	padding: 0px 0px 0px 0px;
	border: solid 1px transparent !important;
}
Is there any way using CSS that I can treat the styling of all menu items as one unit?

Thanks, Paul
  #2  
Old Mar 26, 2018, 03:58 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Can you provide an export of your Atahualpa settings (ATO->Export/Import) attach the file it creates.

Also do you want the menu background to only be the size of the menu? i.e. on a larg screen, the menu on;y covers a part of the width of the screen, is that how much the background color should cover?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Mar 26, 2018 at 04:04 AM.
  #3  
Old Mar 26, 2018, 04:07 AM
Paul Gingell
 
10 posts · Nov 2012
England
I've solved the issue of wrapping all menu items in a single background by using display: table; which negates the need to specify a width.

Code:
div#menu1 ul.rMenu {
	background-color: rgba(135, 135, 135, 0.25) !important;
	-webkit-box-shadow: 0 0 50px rgba(0, 0, 0, 0.25) inset;
	-moz-box-shadow: 0 0 50px rgba(0, 0, 0, 0.25) inset;
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.25) inset;
	-moz-border-radius: 4px; 
	-khtml-border-radius: 4px; 
	-webkit-border-radius: 4px; 
	border-radius: 4px;
	/*width: 385px;*/
	/*height: 40px;*/
	margin-top: -6px;
	padding: 0px 14px 0px 0px;
	border: solid 1px transparent !important;
	display: table;
}
This did create an unexpected space under the menu items, which I had to reverse by using margin-bottom: -22px in my menu item CSS. This solution seems to work on both desktop and mobile browsers.

Code:
ul.rMenu-hor li,
ul.rMenu li a:link, 
ul.rMenu li a:visited, 
ul.rMenu li a:hover, 
ul.rMenu li a:active, 
ul.rMenu li {
	background: transparent !important;
	border-top: solid 1px transparent !important;
	border-left: solid 1px transparent !important;
	border-bottom: solid 1px transparent !important;
	border-right: solid 1px transparent !important;
	text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3), -1px -1px 0 rgba(0, 0, 0, 0.1);
	padding: 5px 0 5px 8px;
	margin-right: -6px;
	margin-bottom: -22px
}
  #4  
Old Mar 27, 2018, 04:58 AM
Paul Gingell
 
10 posts · Nov 2012
England
Hi. Yes the menu wanted to be the size of the menu only. I found a solution using display: table; which seems to work. Whether it's the best solution or just a work-around I don't know.

Some of the exported settings (attached) are redundant from my previous site. I didn't know about the export/import function then, and spent an age reassembling it from various notes I'd made!

Cheers,
Paul

Last edited by Paul Gingell; Jan 19, 2019 at 06:50 AM.
  #5  
Old Mar 27, 2018, 02:40 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Well there if you have it working, then that is a solution! congratulations.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
I want a full width header, fixed width content and a background image tsheridan Header configuration & styling 5 Jan 29, 2013 03:46 PM
[SOLVED] Eliminate full width background color on page-right menu rickpoet Page & Category Menu Bars 2 Dec 11, 2012 06:16 PM
HowTo put Logo + Menu withcustom Background colourin sameline with full width? dd69 Header configuration & styling 3 Dec 11, 2012 05:20 AM
[SOLVED] Full width header with fixed width image and background color WilliamNavidson Header configuration & styling 4 Jun 10, 2011 03:13 AM


All times are GMT -6. The time now is 12:14 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.