Menu Module Stylesheet

Für Fragen und Diskussionen zum Layout und Design, Templates und Stylesheets sowie Themes
Post Reply
SCM
Forum Members
Forum Members
Posts: 74
Joined: Fri Mar 13, 2009 1:01 pm

Menu Module Stylesheet

Post by SCM »

Hallo zusammen,

Ich habe gerade mal mit einer neuen Seite angefangen die zwar noch keinen Inhalt und ausser 2 komischen Farben auch noch kein Design hat, aber ich habe doch schon ein kleines Problem.

Unter http://www.ovlu.li/ornitholog/cms/ ist die Homepage online.

Das vertikale Menu funktioniert auch gut, nur wenn ein Menupunkt aus der vertikalen Menuliste nochmals einen oder mehreren Unterpunkten hat, dann wird dieser Menupunkt anders dargestellt als die restlichen Menupunkte. Als Beispiel Kleintierzucht -> Kaninchen.

Das Sylesheet sieht folgendermassen aus:

Code: Select all

/******************** MENU *********************/
#menu_vert {
	margin: 0;
	padding: 0;
font-size:12pt;
line-height:18pt;
font-family: "Lithos Pro Regular";
}
#menu_vert ul {
/* remove any bullets */
	list-style: none;
/* margin/padding set in li */
	margin: 0px;
	padding: 0px;
}
#menu_vert ul ul {
		display: block;
	margin: 0;
	padding-left: 1.5em;
}
#menu_vert li {
/* remove any bullets */
	list-style: none;
/* negative bottom margin pulls them together, images look like one border between */
	margin: 0px 0px -1px;
/* bottom padding pushes "a" up enough to show our image */
	padding: 0px 0px 0px 0px;
/* you can set your own image here */
	//background: transparent url(uploads/ngrey/liup.gif) no-repeat right bottom;
}

#menu_vert li.currentpage {
        color: #000000;
//padding-left: 1.5em;
background-color: #4068a6;


}

#menu_vert li.menuactive {
	margin: 0;
	padding: 0px;
/* replaced by image in ul ul */
       background: none;
}
#menu_vert li.menuactive ul {
	margin: 0;
}
#menu_vert li.activeparent {
	margin: 0;
	padding: 0px;
}
/* fix stupid IE6 bug with display:block; */
* html #menu_vert li {
	height: 1%;
}
* html #menu_vert li a {
	height: 1%;
}
* html #menu_vert li hr {
	height: 1%;
}
/** end fix **/
/* first level links */
div#menu_vert a {
/* IE6 has problems with this, fixed above */
	display: block;
/* some air for it */
	padding: 0.8em 0.3em 0.5em 1.5em;
/* this will be link color for all levels */
	color: #000000;
/* Fixes IE7 whitespace bug */
	min-height: 1em;
/* no underline for links */
	text-decoration: none;
/* you can set your own image here this is tall enough to cover text heavy links */
	//background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
}
/* next level links, more padding and smaller font */
div#menu_vert ul ul a {
	font-size: 90%;
	padding: 0.8em 0.3em 0.5em 2.8em;
}
/* third level links, more padding */
div#menu_vert ul ul ul a {
	padding: 0.5em 0.3em 0.3em 3em;
}
/* hover state for all links */
div#menu_vert a:hover {
	//background-color: transparent;
background-color: #4068a6;
	color: #000000;
}
div#menu_vert a.activeparent:hover {
	color: #000000;
background-color: #4068a6;
}
/* active parent, that is the first level parent of a child page that is the current page */
div#menu_vert li.activeparent {
/* you can set your own image here */
	//background: transparent url(uploads/ngrey/liup.gif) no-repeat right -65px;
background-color: #4068a6;
/* white to contrast with background image */
	//color: #fff;
}
div#menu_vert li.activeparent a.activeparent {
/* you can set your own image here */
//	background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
/* to contrast with background image */
	color: #000;
}
div#menu_vert li a.parent {
/* takes left padding out so span image has room on left */
	padding-left: 0em;
}
div#menu_vert ul ul li a.parent {
/* increased padding on left offsets it from one above */
	padding-left: 0.9em;
}
div#menu_vert li a.parent span {
	display: block;
	margin: 0;
/* adds left padding taken out of "a.parent" */
	padding-left: 1.5em;
/* arrow on left for pages with children, points down, you can set your own image here */
//	background: transparent url(uploads/ngrey/active.png) no-repeat 2px center;
//background-color: #4068a6;
}
div#menu_vert li a.parent:hover {
/* removes underline hover effect */
	text-decoration: none;
background-color: #4068a6;
}
div#menu_vert li a.parent:hover span {
	display: block;
	margin: 0;
	padding-left: 1.5em;
background-color: #abb980;
/* arrow on left for pages with children, points right for hover, you can set your own image here */
	//background: transparent url(uploads/ngrey/parent.png) no-repeat 2px center;
}
div#menu_vert li a.menuactive.menuparent {
/* sets it in a little more than a.parent */
	padding-left: 0.35em;
}
div#menu_vert ul ul li a.menuactive.menuparent {
/* sets it in a little more on next level */
	padding-left: 0.99em;
}
div#menu_vert li a.menuactive.menuparent span {
	display: block;
	margin: 0;
/* to contrast with non active pages */
	//font-weight: bold;
	padding-left: 1.5em;
/* arrow on left for active pages with children, points right, you can set your own image here */
//	background: transparent url(uploads/ngrey/parent.png) no-repeat 2px center;
background-color: #4068a6;
}
div#menu_vert li a.menuactive.menuparent:hover {
	text-decoration: none;
	color: #000000;
background-color: #4068a6;
}
div#menu_vert ul ul li a.activeparent {
	color: #fff;
}
/* current pages in the default Menu Manager template are unclickable. This is for current page on first level */
div#menu_vert ul h3 {
	display: block;
/* some air for it */
	padding: 0.8em 0.5em 0.5em 1.5em;
/* this will be link color for all levels */
	color: #000;
/* instead of the normal font size for <h3> */
	font-size: 1em;
/* as <h3> normally has some margin by default */
	margin: 0;
/* you can set your own image here, same as "a" */
	//background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
}
/* next level current pages, more padding, smaller font and no background color or bottom border */
div#menu_vert ul ul h3 {
	font-size: 90%;
	padding: 0.8em 0.5em 0.5em 2.8em;
/* you can set your own image here, same as "a" */
	//background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
	color: #000;
}
/* current page on third level, more padding */
div#menu_vert ul ul ul h3 {
	padding: 0.6em 0.5em 0.2em 3em;
}
/* BIG NOTE: I didn't do anything to these, never tested */
/* section header */
div#menu_vert li.sectionheader {
	border-right: none;
	padding: 0.8em 0.5em 0.5em 1.5em;
//	background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
	line-height: 1em;
	margin: 0;
        color: #000000;
        cursor:text;
}
/* separator */
div#menu_vert .separator {
	height: 1px !important;
	margin-top: -1px;
	margin-bottom: 0;
	-padding: 2px 0 2px 0;
	background-color: #dadfc5;
	overflow: hidden !important;
	line-height: 1px !important;
	font-size: 1px;
/* for ie */
}
div#menu_vert li.separator hr {
	display: none;
/* this is for accessibility */
}
Wo kann ich nun es so machen, dass Menu Items die noch Unterpunkte haben genau gleich dargestellt werden wie Menu Items die keine Unterpunkte haben?

Vielen Dank!
SCM!
uniqu3

Re: Menu Module Stylesheet

Post by uniqu3 »

Das hier ändern:
div#menu_vert li a.menuactive.menuparent span {
display: block;
margin: 0;
/* to contrast with non active pages */
//font-weight: bold;
padding-left: 1.5em;
/* arrow on left for active pages with children, points right, you can set your own image here */
// background: transparent url(uploads/ngrey/parent.png) no-repeat 2px center;
background-color: #4068a6;
}
Auskommentieren geht  so /* das hier wird im stylesheet nicht mehr gelesen */ und nicht wie bei dir //font-weight: bold; was "Kaninchen" als fett geschrieben darstellt.

Edit: ich glaube ich habe erst deine frage falsch verstanden, ich vermute Du möchtest die Hintergrund farbe von Kaninchen weg haben?

Falls dein CSS hier die richtige stelle ist versuche es mit:
div#sidebar #menu_vert li.menuparent {
       color: #000000;
//padding-left: 1.5em;
/*background-color: #4068a6;*/


}
Last edited by uniqu3 on Sat Jul 24, 2010 12:27 pm, edited 1 time in total.
SCM
Forum Members
Forum Members
Posts: 74
Joined: Fri Mar 13, 2009 1:01 pm

Re: Menu Module Stylesheet

Post by SCM »

danke dir!

Dann weiss ich schon mal wo ich was änderen muss. Das Problem ist, ich weiss nicht genau welcher Eintrag im Stylesheet der Eintrag für das Menu Item ohne Unterpunkte ist. Irgendwoher muss ich ja die richtigen Styles kopieren und in dem Eintrag den du mir gezeigt hast einfügen.

Und ich habe gerade auch noch gemerkt dass der Hover Effekt auch falsch ist :(
owr_bgld

Re: Menu Module Stylesheet

Post by owr_bgld »

Guter Tipp: Nimm dir den jeweiligen Quelltext von deinen Seiten vor.

Beim Vorstand hast du folgendes:

Code: Select all

<li class="currentpage"><h3><span>Vorstand</span></h3></li>
d.h. er hat die Klasse "currentpage" und span (kein Link), beim Kaninchen hat er folgendes:

Code: Select all

<li class="menuactive menuparent"><a class="menuactive menuparent" href="http://www.ovlu.li/ornitholog/cms/index.php?page=kaninchen"><span>Kaninchen</span></a> .... die ganzen untermenübpunkte .... </li>
dh. er hat den a-tag weil das ganze als Link ausgeführt ist.

Müste also folgendes geändert werden:
div#menu_vert li a.menuactive {  /* Kann auch sein dass du .menuparent mit Hintergrund versehen musst */
/* sets it in a little more on next level */
padding-left: 0.99em;
background-color: #4068a6; (du hast hier none)
}

obwohl wenn ich mir das ganze so ansehe - ist da nicht ein kleiner Fehler drinnen class="menuactive menuparent" funktioniert das überhaupt mit Leerzeichen?

stell mal dein Menütemplate online
uniqu3

Re: Menu Module Stylesheet

Post by uniqu3 »

Ah ich denke jetzt habe ich endlich verstanden was Du willst.

"Kaninchen" soll wie "Vorstand" aussehen? Dann alles oben ignorieren und diese Änderungen vornehmen.

Normalzustand:

/* Das ist das style für haupt links in der sidebar navigation */
div#menu_vert a, div#menu_vert a.menuparent {
/* IE6 has problems with this, fixed above */
display: block;
/* some air for it */
padding: 0.8em 0.3em 0.5em 1.5em;
/* this will be link color for all levels */
color: #000000;
/* Fixes IE7 whitespace bug */
min-height: 1em;
/* no underline for links */
text-decoration: none;
/* you can set your own image here this is tall enough to cover text heavy links */
//background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
}
Activ:
#menu_vert li.currentpage,  #menu_vert li.menuactive{
       color: #000000;
//padding-left: 1.5em;
background-color: #4068a6;


}
Ich denke so sollte es funktioneren.

@owr_web ja das mit leerzeichen funktionert, es werden zwei classen angewendet, so ist es angenehmer mit stylesheets arbeit zbsp. bei grid frameworks und so.
ode:
Kaninchen .... die ganzen untermenübpunkte ....
Das problem hier ist das eins der classen weg muss, sonst gibt es probleme beim stylen wenn nicht alles genaustens definiert ist wie li.menuactive oder li a.menuactive etc.
Last edited by uniqu3 on Sat Jul 24, 2010 1:23 pm, edited 1 time in total.
SCM
Forum Members
Forum Members
Posts: 74
Joined: Fri Mar 13, 2009 1:01 pm

Re: Menu Module Stylesheet

Post by SCM »

Ja genau das will ich ;) Ich probiere es gleich mal! Danke!
Attachments

[The extension txt has been deactivated and can no longer be displayed.]

SCM
Forum Members
Forum Members
Posts: 74
Joined: Fri Mar 13, 2009 1:01 pm

Re: Menu Module Stylesheet

Post by SCM »

ich habe es mal geändert, aber noch funktioniert es nicht ganz. Jetzt ist immer die gesamte Liste markiert. Hier nochmals der gesamte Code:

Code: Select all

/******************** MENU *********************/
#menu_vert {
	margin: 0;
	padding: 0;
font-size:12pt;
line-height:18pt;
font-family: "Lithos Pro Regular";
}
#menu_vert ul {
/* remove any bullets */
	list-style: none;
/* margin/padding set in li */
	margin: 0px;
	padding: 0px;
}
#menu_vert ul ul {
		display: block;
	margin: 0;
	padding-left: 1.5em;
}
#menu_vert li {
/* remove any bullets */
	list-style: none;
/* negative bottom margin pulls them together, images look like one border between */
	margin: 0px 0px -1px;
/* bottom padding pushes "a" up enough to show our image */
	padding: 0px 0px 0px 0px;
/* you can set your own image here */
	//background: transparent url(uploads/ngrey/liup.gif) no-repeat right bottom;
}

#menu_vert li.currentpage,  #menu_vert li.menuactive{
        color: #000000;
//padding-left: 1.5em;
background-color: #4068a6;


}
#menu_vert li.menuactive ul {
	margin: 0;
}
#menu_vert li.activeparent {
	margin: 0;
	padding: 0px;
}
/* fix stupid IE6 bug with display:block; */
* html #menu_vert li {
	height: 1%;
}
* html #menu_vert li a {
	height: 1%;
}
* html #menu_vert li hr {
	height: 1%;
}
/** end fix **/
/* first level links */
div#menu_vert a, div#menu_vert a.menuparent {
/* IE6 has problems with this, fixed above */
   display: block;
/* some air for it */
   padding: 0.8em 0.3em 0.5em 1.5em;
/* this will be link color for all levels */
   color: #000000;
/* Fixes IE7 whitespace bug */
   min-height: 1em;
/* no underline for links */
   text-decoration: none;
/* you can set your own image here this is tall enough to cover text heavy links */
   //background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
}
/* next level links, more padding and smaller font */
div#menu_vert ul ul a {
	font-size: 90%;
	padding: 0.8em 0.3em 0.5em 2.8em;
}
/* third level links, more padding */
div#menu_vert ul ul ul a {
	padding: 0.5em 0.3em 0.3em 3em;
}
/* hover state for all links */
div#menu_vert a:hover {
	//background-color: transparent;
background-color: #4068a6;
	color: #000000;
}
div#menu_vert a.activeparent:hover {
	color: #000000;
background-color: #4068a6;
}
/* active parent, that is the first level parent of a child page that is the current page */
div#menu_vert li.activeparent {
/* you can set your own image here */
	//background: transparent url(uploads/ngrey/liup.gif) no-repeat right -65px;
background-color: #4068a6;
/* white to contrast with background image */
	//color: #fff;
}
div#menu_vert li.activeparent a.activeparent {
/* you can set your own image here */
//	background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
/* to contrast with background image */
	color: #000;
}
div#menu_vert li a.parent {
/* takes left padding out so span image has room on left */
	padding-left: 0em;
}
div#menu_vert ul ul li a.parent {
/* increased padding on left offsets it from one above */
	padding-left: 0.9em;
}
div#menu_vert li a.parent span {
	display: block;
	margin: 0;
/* adds left padding taken out of "a.parent" */
	padding-left: 1.5em;
/* arrow on left for pages with children, points down, you can set your own image here */
//	background: transparent url(uploads/ngrey/active.png) no-repeat 2px center;
//background-color: #4068a6;
}
div#menu_vert li a.parent:hover {
/* removes underline hover effect */
	text-decoration: none;
background-color: #4068a6;
}
div#menu_vert li a.parent:hover span {
	display: block;
	margin: 0;
	padding-left: 1.5em;
background-color: #abb980;
/* arrow on left for pages with children, points right for hover, you can set your own image here */
	//background: transparent url(uploads/ngrey/parent.png) no-repeat 2px center;
}
div#menu_vert li a.menuactive.menuparent {
/* sets it in a little more than a.parent */
	padding-left: 0.35em;
}
div#menu_vert ul ul li a.menuactive.menuparent {
/* sets it in a little more on next level */
	padding-left: 0.99em;
}
div#menu_vert li a.menuactive.menuparent span {
	display: block;
	margin: 0;
/* to contrast with non active pages */
	//font-weight: bold;
	padding-left: 1.5em;
/* arrow on left for active pages with children, points right, you can set your own image here */
//	background: transparent url(uploads/ngrey/parent.png) no-repeat 2px center;
background-color: #4068a6;
}
div#menu_vert li a.menuactive.menuparent:hover {
	text-decoration: none;
	color: #000000;
background-color: #4068a6;
}
div#menu_vert ul ul li a.activeparent {
	color: #fff;
}
/* current pages in the default Menu Manager template are unclickable. This is for current page on first level */
div#menu_vert ul h3 {
	display: block;
/* some air for it */
	padding: 0.8em 0.5em 0.5em 1.5em;
/* this will be link color for all levels */
	color: #000;
/* instead of the normal font size for <h3> */
	font-size: 1em;
/* as <h3> normally has some margin by default */
	margin: 0;
/* you can set your own image here, same as "a" */
	//background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
}
/* next level current pages, more padding, smaller font and no background color or bottom border */
div#menu_vert ul ul h3 {
	font-size: 90%;
	padding: 0.8em 0.5em 0.5em 2.8em;
/* you can set your own image here, same as "a" */
	//background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
	color: #000;
}
/* current page on third level, more padding */
div#menu_vert ul ul ul h3 {
	padding: 0.6em 0.5em 0.2em 3em;
}
/* BIG NOTE: I didn't do anything to these, never tested */
/* section header */
div#menu_vert li.sectionheader {
	border-right: none;
	padding: 0.8em 0.5em 0.5em 1.5em;
//	background: transparent url(uploads/ngrey/libk.gif) no-repeat right top;
background-color: #4068a6;
	line-height: 1em;
	margin: 0;
        color: #000000;
        cursor:text;
}
/* separator */
div#menu_vert .separator {
	height: 1px !important;
	margin-top: -1px;
	margin-bottom: 0;
	-padding: 2px 0 2px 0;
	background-color: #dadfc5;
	overflow: hidden !important;
	line-height: 1px !important;
	font-size: 1px;
/* for ie */
}
div#menu_vert li.separator hr {
	display: none;
/* this is for accessibility */
}
uniqu3

Re: Menu Module Stylesheet

Post by uniqu3 »

Sry mein typo:
#menu_vert li.currentpage,  #menu_vert li a.menuactive{
        color: #000000;
//padding-left: 1.5em;
background-color: #4068a6;


}
SCM
Forum Members
Forum Members
Posts: 74
Joined: Fri Mar 13, 2009 1:01 pm

Re: Menu Module Stylesheet

Post by SCM »

sehr sehr gut!! Danke dir vielmals! Alles klappt jetzt. Nur noch dr Hover State funktioniert nicht, aber das sollte ich alleine schaffen indem ich den Farbwert suche ;)
owr_bgld

Re: Menu Module Stylesheet

Post by owr_bgld »

uniqu3 wrote: @owr_web ja das mit leerzeichen funktionert, es werden zwei classen angewendet, so ist es angenehmer mit stylesheets arbeit zbsp. bei grid frameworks und so.
Danke für die Info - hab ich auch wieder was gelernt. Ich habe mich anfangs nämlich bei meinem Template immer über "Fehler" gewundert  ;D
uniqu3

Re: Menu Module Stylesheet

Post by uniqu3 »

Ja für hover sollte könnte es so gehen:
#menu_vert li a:hover.menuactive,  #menu_vert li a:hover.menuparent {
background-color: #deinefarbe;
}
mike-r

Re: Menu Module Stylesheet

Post by mike-r »

@SCM: Dein Problem sollte ja gelöst sein, Du hast allerdings noch ein paar andere:
font-size:12pt;
line-height:18pt;
Bisschen Lesestoff:
http://dciwam.de/faq/gute-websites/einheit-pt
http://dciwam.de/faq/gute-websites/rich ... iftgroesse
font-family: "Lithos Pro Regular";
Das geht so nicht. Erst mal hat kaum jemand diese Schriftart installiert, so dass irgendwas verwendet wird und des weiteren ist das keine "family".
Bisschen Lesestoff:
http://www.css4you.de/Schrifteigenschaf ... amily.html
Post Reply

Return to “Layout und Design”