Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/04/2012, 08:46
Avatar de oaoanton
oaoanton
 
Fecha de Ingreso: diciembre-2011
Mensajes: 22
Antigüedad: 12 años, 4 meses
Puntos: 0
Div dentro div

Muy Buenas!
Estoy haciendo un proyecto para la assignatura de lenguajes de marcas, se trata de crear un web tienda (sin carrito). Yo lo estoy haciendo con XML+PHP i con base de datos MYSQL. El problema que tengo es el sigiente, creo un div i dentro de este quiero que aparezca un nuevo div con una imagen del producto i el nombre, el problema es que me los pone uno debajo del otro, i entonces queda un espacio muy grande, lo que quiero es que aprobeche el espacio, Cuelgo un pantallazo donde les quedara mas claro:
http://imageshack.us/photo/my-images/195/pantallazodw.jpg/


Les paso l codigo por si acaso:

style.css:
body {
background-color:green;
border:9px double black;
margin:0px 0px 0px 0px;
}
.bak {
background-color:lightyellow;
}
.bak2 {
background-color:lightblue;
padding-left:30px;
padding-right:30px;
padding-top:30px;
padding-bottom:30px;
}
.bak3 {
background-color:white;
background-repeat:repeat;
}
.cap {border:9px solid lightblue; background-image:url('../images/cap.jpg'); height:500px; width:997px; padding:0px 0px 0px 0px; display:table-caption; float:center; position:relative; margin-left:10%; margin-bottom:10px; margin-top:3px;}
.menue {
width:250px;
border:9px double black;
background-color:red;
padding:0px;
float:left;
}
.cent {
display:block;
float:center;
}
.mini_moto {
background-color:blue;
border:9px double black;
margin-left:38%;
width:650px;
}
.mini_moto a {
text-decoration:none;
}
.motos {
background-color:blue;
border:9px double black;
margin-bottom:5px;
margin-left:;
width:200px;
}
.motos a {
text-decoration:none;
color:black;
}
.motos a:hover {
color:green;
}
.motos img {
margin-left:25%;
margin-right:25%;
}
.motos img:hover {
border-color:orange;
}



index.php:
<?
header("content-type: text/xml");
echo '<?xml version="1.0" encoding="iso-8859-1"?>';
include "nomfitxer.php";
echo '<?xml-stylesheet type="text/xsl" href="'.$nom_xslt.'"?>';
include "motos_con.inc.php";
echo "<tienda_motos>";
if ($totmotos > 0) {
while ($rowmotos = mysql_fetch_assoc($resmotos)) {
echo " <moto>
<marca>".$rowmotos['marca']."</marca>
<model>".$rowmotos['model']."</model>
<cilindrada>".$rowmotos['cilindrada']."cc</cilindrada>
<cap_combustible>".$rowmotos['cap_combustible']."</cap_combustible>
<carga_max>".$rowmotos['carga_max']."</carga_max>
<neumatico_del>".$rowmotos['neumatico_del']."</neumatico_del>
<neumatico_tras>".$rowmotos['neumatico_tras']."</neumatico_tras>
<num_marchas>".$rowmotos['num_marchas']."</num_marchas>
<desc>".$rowmotos['desc']."</desc>
</moto>";
}
};
echo "</tienda_motos>";
mysql_close($con);
?>






xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">

<xsl:output method="xml" indent="yes" encoding="UTF-8"/>

<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es">
<head>
<title>Videoclub</title>
<link rel="stylesheet" type="text/css" href="style/style.css"/>
</head>
<body>
<div class="bak">
<xsl:apply-templates select="/tienda_motos" />
</div>
</body>
</html>
</xsl:template>

<xsl:template match="tienda_motos">
<div width="100%">
<div class="cap"></div>
<div class="menue"><center><h1><u>Categories</u></h1><h1><u>Busqueda Avançada</u></h1></center></div>
<div class="mini_moto"><div class="bak2"><xsl:apply-templates select="moto" /></div></div>
</div>
</xsl:template>

<xsl:template match="moto">
<div class="motos"><div class="bak3"><center><a href="#"><xsl:value-of select="marca" /><br /><xsl:value-of select="model" /><img width="100px" height="100px" src="images/yamaha-r6-2.jpeg" /></a></center></div></div>
</xsl:template>

</xsl:stylesheet>








motos_con.inc:
<?php
$con = mysql_connect ("localhost", "root", "");
mysql_select_db("projecte", $con);
$motos = "SELECT * FROM motos";
$resmotos = mysql_query($motos, $con) or die (mysql_error("No s'ha pogut conectar"));
$totmotos = mysql_num_rows($resmotos);
?>











nomfitxer.php:
<?php
/* Nom del fitcher xsl */
if (isset($_REQUEST['nom'])) {
$nom_xslt=$_REQUEST['nom'];
} else {
$nom_xslt="motos.xsl";
}
?>

Gracias de antemano a posibles ayudas!