Jsp com css

3 respostas
E

pessoal, tenho uma aplicação web bem simples. utilizando struts 1.3.5… gostaria de colocar um menu na pag inicial dela. aí já coloquei um arquivo menu.jsp e o include no index.jsp ja pra ele trazer o menu e tal…
mas já tentei algumas vezes fazer esse menu ficar com os estilos que estão no arquivo menu.jsp mas não deu certo. alguém sabe como devo fazer?

3 Respostas

otaviofcs

O menu.jsp tem as mesmas tags do seu css? fica na mesma página (ou você tá fazendo um frame? Se for frame não carrega o mesmo css… Falta explicação, posta o html com o css da sua página.

E

nao to fazendo frame…aí vai o código do menu.jsp

<div class="menuBox">
	<div class="menuText">
		<div id="menu" style="border-width: 0px; position: absolute; left: 25px; top: 0px; height: 18px;">
			<ul  >
				<li ><a >Cadastro</a>
					<ul >					
						<li><a >Agendamento</a></li>							
			</ul>
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;

segue o css:

/* 
 *	Horizontal, top-2-bottom
 *	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 *	(c) 2004 - Aleksandar Vacic, www.aplus.co.yu
 * Some rights reserved, http://creativecommons.org/licenses/by/2.0/
 *	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 */

/*		------	Basic style	------		*/

#menu {
	
	font-size: 10pt;
	font-family: arial, helvetica, sans-serif;
	color: #666;

}

#menu ul {
	margin: 0;
	padding: 0;
	list-style-type: none;
	
	left: -15px;
	position: relative;
}

#menu li {
	margin: 0;
	padding: 0;
	border: 0;
	display: block;
	float: left;
	position: relative;
	
	height: 38px;
	width: 100px;
	
	border-top: 1px solid #C2CDE2;
	border-bottom: 1px solid #C2CDE2;
	border-right: 1px solid #C2CDE2;
}

#menu li li:hover {
	BACKGROUND-COLOR: #FFFFFF;

}

#menu a {
	display: block;
	PADDING-RIGHT: 13px; 
	PADDING-LEFT: 13px; 
	PADDING-BOTTOM: 0px; 
	COLOR: #666; 
	PADDING-TOP: 0px; 
	TEXT-ALIGN: center; 
	text-decoration: none;
	height: 23px;
}

#menu li li {
	width: 200px;
	height: 25px;
	
	border-left: #99D1F3 0px solid; 
	border-right: #99D1F3 0px solid; 
	border-bottom: #99D1F3 0px solid; 

	BACKGROUND-COLOR: #D3E6F0;
}

/* fix the position for 2nd level submenus. first make sure no horizontal scrollbars are visible on initial page load... */
#menu li li ul {
	top: 0px;
	left: 0px;
}

#menu ul li a {
	padding-top: 10px;
	height: 23px;
}

#menu ul li ul li a {
	padding-top: 0px;
	text-align: left;
}

/* ...and then place it where it should be when shown */
#menu li li:hover ul {
	left: 100%;
}

/* initialy hide all sub menus */
#menu li ul {
	display: none;
	position: absolute;
	z-index: 10;

	WIDTH: 200px; 
	HEIGHT: 25px;
	COLOR: #000; 
	BACKGROUND-COLOR: 666;
	PADDING-TOP: -10px; 
}

/* display them on hover */
#menu li:hover&gtul {
	display: block;
}

/* this is needed if you want to style #menu div - force containment of floated LIs inside of main UL */
#menuList:after {
	content: ".";
	height: 0;
	display: block;
	visibility: hidden;
	overflow: hidden;
	clear: both;
}

#menu LI LI.submenu {
	background: url("../../images/Rarrow.gif");
	background-repeat: no-repeat;
	background-position: right;
}
	

/* Clear-fix for IE5/Mac \*//*/
#menu a {
	float: left;
}

#menuList {
	display: inline-block;
}
/*  */

/*		------   Make-up	--------			*/
otaviofcs

O correto é ver a sua saída html para saber se seu menu.jsp está entrando antes ou depois da chamada do css

&lt;div id="menu" style="border-width: 0px; position: absolute; left: 25px; top: 0px; height: 18px;"&gt;

2 coisas:

  1. seu div não está usando a classe menu mas sim possui o id menu. deve ser isso o seu problema;
  2. se você tá colocando um css porque usa style dentro do seu div;

abraços,

otávio

Criado 29 de janeiro de 2007
Ultima resposta 29 de jan. de 2007
Respostas 3
Participantes 2