Imagem em div de um jsp/jsf

3 respostas
L

As imagem da tag <img estão aparecendo mas as da tag <div não aguem sabe o pq??

codigo abaixo:

<%@ page language=“java” contentType="text/html; charset=ISO-8859-1"
pageEncoding=“ISO-8859-1”%>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> Login de Usuários Usando JSF
<link href="jquery-ui.css" rel="stylesheet" type="text/css"/>
<div id="fundo" style="position: relative;top:100px; width:525; height:420; background-image:url('imagem\caixa_login4.png')">
    
    <h:inputText value="#{usuarioBean.nome}" id="tf_usuario" style="position: relative; left:150px; top:173px; width:170; height:20;"/>

    <h:inputSecret value="#{usuarioBean.senha}"  id="pass_usuario" style="position: relative; left: -25px; top:210px; width:170; height:20;"/>

   <h:commandButton value="Login" action="#{usuarioBean.verificarUsuario}" style="position: relative;left:;top:215px;" />

      <div id="e1" style="position: relative;left:-15px;top:224px;">

        <img id="img1" NAME="img1" BORDER="0" SRC="imagem\esqueci.png" width="126" height="22" onMouseOver="document.img1.src='imagem\esquecib.png'"onMouseOut="'img1.src=imagem\esqueci.png'" >

        <img id="img2" NAME="img2" BORDER="0" SRC="imagem\cadastrar.png" width="58" height="22" style="position: relative; left: 50px;" onMouseOver="img2.src='imagem\cadastrarb.png'"onMouseOut="'img2.src=imagem\cadastrar.png'" >
    
    </div>
  </div> 
    
   <div id="cadastro" style = " position: relative; top: -15px; left: 7px; width:303; height:176; background-image:url('imagem\caixa_logint.png');">
      <img id="fechar" NAME="fechar" BORDER="0" SRC="imagem\fechar.png" width="20" height="20" style="position: relative; left: -45px; top: 10px;">
   
      <input type="text" id="nome" style="position: relative; top:30px; left: 40px; width:170; height:20;">
      
      <input type="text" id="nome2" style="position: relative; top:60px; left: 50px; width:170; height:20;">
      
      <input type="text" id="nome3" style="position: relative; top:90px; left: 50px; width:170; height:20;">
   </div>
   
   <div id="senha" style = " position: relative; bottom: 385px; left: 7px;  width:303; height:176; background-image:url('imagem\caixa_senha.png');">
      <img id="fechar2" NAME="fechar2" BORDER="0" SRC="imagem\fechar.png" width="20" height="20" style="position: relative; left: -45px; top: 10px;">
   
      <input type="text" id="nome" style="position: relative; top:30px; left: 40px; width:170; height:20;">
   
      <input type="text" id="nome2" style="position: relative; top:60px; left: 50px; width:170; height:20;">
   
      <input type="text" id="nome3" style="position: relative; top:90px; left: 50px; width:170; height:20;">
   </div>





</h:form>

3 Respostas

M
Cara esta faltando algumas especificações na sua div:finalizar a div,especificar os pxs da altura e largura, use a barra pra direita. Ex:
<div id="fundo" style="position: relative;top:100px; width:525px; height:120px; background-image:url('images/minhaImagem.png')"> </div>

E quando for postar códigos coloque entre a tag [code], ficar melhor a visualização.

L

Não deu muito certo, eu fiz um teste se eu usar a tag <f: view e a <h:form ele nâo aparece imagem mas se eu colocar background color aparece a cor.

Alguem sabe o por que da imagem não aparece e a cor sim??

M

Eu não sei porque a imagem não esta aparecendo no seu projeto, mas o exemplo que te passei eu testei dentro das tags <f: view e a <h:form e funcionaram perfeitamente aqui.

Criado 15 de agosto de 2010
Ultima resposta 18 de ago. de 2010
Respostas 3
Participantes 2