CSS - centrar divs con background en css

 
Vista:

centrar divs con background en css

Publicado por javiler (2 intervenciones) el 20/04/2013 17:32:10
hola x mas q busco no soluciono el problema de centrar las imagenes dentro de la imagen del background.

os dejo el codigo.

html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/principal.css"/>
<title>www.aupaleganes.com Toda la actualidad del Cd Leganés</title>
</head>
 
<body>
<div id="midiv">
	<div id="centrado"><img src="imagenes/escudoleganes.gif" width="227" height="139" /></div><div id="publi">  <script type="text/javascript">
var uri = 'http://impes.tradedoubler.com/imp?type(img)g(18583144)a(2247393)' + new String (Math.random()).substring (2, 11);
document.write('<a href="http://clk.tradedoubler.com/click?p=140883&a=2247393&g=18583144" target="_BLANK"><img src="'+uri+'" border=0></a>');
</script></div>
</div>
</body>
</html>


css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@charset "utf-8";
/* CSS Document */
 
body {
	background-image:url(/imagenes/indice.jpg);
	background-position: center;
	background-repeat: no-repeat;
}
#midiv {
width:960px;
}
#centrado {
	float:left;
	height:-100px;
	width:-500px;
}
#publi {
	height:-500px;
	width:-1500px;
}


muchas gracias. a ver si podeis decirme q hago mal.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 624
Oro
Ha mantenido su posición en CSS (en relación al último mes)
Gráfica de CSS

centrar background en medio de la pantalla con css

Publicado por xve (490 intervenciones) el 20/04/2013 19:03:14
Hola Javiler, no me queda muy claro cual es tu problema, pero si el problema es centrar el background seria algo así:
1
background:url(/imagenes/indice.jpg) no-repeat center center fixed;

Coméntanos, ok?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

centrar background en medio de la pantalla con css

Publicado por javier (2 intervenciones) el 20/04/2013 21:21:39
precisamente el fondo es el q esta centrado lo q no se me centra es la imagen del escudo y la publicidad
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar