HTML - Fondo aleatorio + alineación bloque

 
Vista:

Fondo aleatorio + alineación bloque

Publicado por Micky (2 intervenciones) el 31/05/2012 10:09:12
Hola amigos. Tengo el siguiente código (ahora lo pego). Me gustaría poner un fondo aleatorio cada vez que entro en la página web. Para ello debería hacer un random etc dentro del body{...} pero no sé porqué ninguna forma explicada en internet me sirve, en concreto se me queda en negro (luego algo hago mal).

La otra cuestión es alinear el bloque que contiene los labels Usuario, Pass, etc...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!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" dir="ltr" id="min-width" lang="es" xml:lang="es"   ><head><title>Conectarse</title><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta http-equiv="content-script-type" content="text/javascript" /><meta http-equiv="content-style-type" content="text/css" /><link rel="shortcut icon" type="image/x-icon" href="http://i46.servimg.com/u/f46/15/36/79/15/xrosno10.png" /><meta name="robots" content="noindex, follow" /><meta name="title" content="Conectarse" /><link rel="stylesheet" href="/104-ltr.css" type="text/css" /><link rel="search" type="application/opensearchdescription+xml" href="/improvedsearch.xml" title="" />
 
<style type="text/css">
body{
background-image:url('http://img854.imageshack.us/img854/3626/rainingentrada.jpg');
background-color:black;
background-attachment: fixed;
}
</style>
 
<script type="text/javascript">//<![CDATA[
&#36;(document).ready(function(){});//]]></script>
 
</head>
 
<script type="text/javascript">//<![CDATA[
document.MAX_ct0 ='';var m3_u = (location.protocol=='https:'?'https://cas.criteo.com/delivery/ajs.php?':'http://cas.criteo.com/delivery/ajs.php?');var m3_r = Math.floor(Math.random()*99999999999);document.write("<scr"+"ipt type='text/javascript' src='"+m3_u);document.write("zoneid=42505&amp;prlog=");document.write("&amp;nodis=1");document.write('&amp;cb=' + m3_r);if (document.MAX_used != ',') document.write("&amp;exclude=" + document.MAX_used);document.write(document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));document.write("&amp;loc=" + escape(window.location));if (document.referrer) document.write("&amp;referer=" + escape(document.referrer));if (document.context) document.write("&context=" + escape(document.context));if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {document.write("&amp;ct0=" + escape(document.MAX_ct0));}if (document.mmm_fo) document.write("&amp;mmm_fo=1");document.write("'></scr"+"ipt>");//]]>
</script>

<br class="clear" /></div><div style="clear:both;"></div><style type="text/css">html body .i91a3d04d,html body .i91a3d04d iframe,html body iframe[name="google_ads_frame"],html body .i91a3d04d iframe[name="google_ads_frame"],html body #wrap #page-body div.i91a3d04d,html body #page-body .i91a3d04d{display:block!important;visibility:visible!important;float:none!important;position:inherit!important;left:inherit!important;top:inherit!important;right:inherit!important;bottom:inherit!important;margin:0 auto!important;padding:inherit!important;filter:alpha(opacity=100)!important;-moz-opacity:1!important;-khtml-opacity:1!important;opacity:1!important;z-index:9999!important;text-align:center!important}html body .i91a3d04d,html body .i91a3d04d iframe[name="google_ads_frame"]{width:728px!important;height:90px!important;min-height:90px!important}html body .i91a3d04d iframe{border:0px!important}html body iframe[name="google_ads_frame"]{width:100%!important;height:inherit!important;min-height:inherit!important}</style></div>

<form action="/login" method="post" name="form_login"><div class="inner"><div class="content">

<fieldset class="fields1 left fld_connexion"><dl><dt><label for="username">Nombre de Usuario:</label></dt><dd><input type="text" tabindex="1" name="username" id="username" size="25" maxlength="40" value="" class="inputbox autowidth" /></dd></dl><dl><dt><label for="password">Contraseña:</label></dt><dd><input type="password" tabindex="2" id="password" name="password" size="25" maxlength="25" class="inputbox autowidth" /></dd><dd><a href="/profile?mode=sendpassword">Recuperar mi contraseña</a></dd></dl><dl><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="4" checked="checked" class="radio" /> Entrar automáticamente en cada visita</label></dd></dl><dl><dt>&nbsp;</dt><dd><input type="hidden" name="redirect" value="" /><input type="hidden" name="query" value="" /><input type="submit" name="login" tabindex="6" value="Conectarse" class="button1" /></dd></dl></fieldset>

</div>

<script type="text/javascript">
function cartel() {
var x = document.getElementById("i_icon_mini_logout");
if (x != null) {
return true;}
else {
return false;}
}
if (cartel()) {
window.location="http://rainingblood.foroactivo.com/forum/";
}
</script>

<script type="text/javascript">//<![CDATA[
if(document.forms['form_login'].elements['username'].value == ''){document.forms['form_login'].elements['username'].focus();}else{document.forms['form_login'].elements['password'].focus();}//]]></script><div class="inner">

<table>
<a href="/register" class="button2">Registrarse</a></div>
<div style="float: ;">
<table/>

<table>
<a href="http://www.foroactivo.com" target="main"> </a><br />
</table>
</div>




</div></div><p class="copyright"><strong></strong></p></div></div></div></div></div><script type="text/javascript">//<![CDATA[
fa_endpage();//]]>

</script>

</body>

</html>


El código que quiero ponerle fondo aleatorio es:

1
2
3
4
5
6
7
<style type="text/css">
body{
background-image:url('http://img854.imageshack.us/img854/3626/rainingentrada.jpg');
background-color:black;
background-attachment: fixed;
}
</style>


El código que quiero alinear es:

1
<fieldset class="fields1 left fld_connexion"><dl><dt><label for="username">Nombre de Usuario:</label></dt><dd><input type="text" tabindex="1" name="username" id="username" size="25" maxlength="40" value="" class="inputbox autowidth" /></dd></dl><dl><dt><label for="password">Contraseña:</label></dt><dd><input type="password" tabindex="2" id="password" name="password" size="25" maxlength="25" class="inputbox autowidth" /></dd><dd><a href="/profile?mode=sendpassword">Recuperar mi contraseña</a></dd></dl><dl><dd><label for="autologin"><input type="checkbox" name="autologin" id="autologin" tabindex="4" checked="checked" class="radio" /> Entrar automáticamente en cada visita</label></dd></dl><dl><dt>&nbsp;</dt><dd><input type="hidden" name="redirect" value="" /><input type="hidden" name="query" value="" /><input type="submit" name="login" tabindex="6" value="Conectarse" class="button1" /></dd></dl></fieldset>


Y ya por último me gustaría saber que hacen los siguientes códigos, que como he heredado del código de mi propio foro, no sé si puedo/debo limpiarlo (ya limpié otras partes, pero estas no sé que hacen):

1
2
3
<script type="text/javascript">//<![CDATA[
document.MAX_ct0 ='';var m3_u = (location.protocol=='https:'?'https://cas.criteo.com/delivery/ajs.php?':'http://cas.criteo.com/delivery/ajs.php?');var m3_r = Math.floor(Math.random()*99999999999);document.write("<scr"+"ipt type='text/javascript' src='"+m3_u);document.write("zoneid=42505&amp;prlog=");document.write("&amp;nodis=1");document.write('&amp;cb=' + m3_r);if (document.MAX_used != ',') document.write("&amp;exclude=" + document.MAX_used);document.write(document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));document.write("&amp;loc=" + escape(window.location));if (document.referrer) document.write("&amp;referer=" + escape(document.referrer));if (document.context) document.write("&context=" + escape(document.context));if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {document.write("&amp;ct0=" + escape(document.MAX_ct0));}if (document.mmm_fo) document.write("&amp;mmm_fo=1");document.write("'></scr"+"ipt>");//]]>
</script>


1
<br class="clear" /></div><div style="clear:both;"></div><style type="text/css">html body .i91a3d04d,html body .i91a3d04d iframe,html body iframe[name="google_ads_frame"],html body .i91a3d04d iframe[name="google_ads_frame"],html body #wrap #page-body div.i91a3d04d,html body #page-body .i91a3d04d{display:block!important;visibility:visible!important;float:none!important;position:inherit!important;left:inherit!important;top:inherit!important;right:inherit!important;bottom:inherit!important;margin:0 auto!important;padding:inherit!important;filter:alpha(opacity=100)!important;-moz-opacity:1!important;-khtml-opacity:1!important;opacity:1!important;z-index:9999!important;text-align:center!important}html body .i91a3d04d,html body .i91a3d04d iframe[name="google_ads_frame"]{width:728px!important;height:90px!important;min-height:90px!important}html body .i91a3d04d iframe{border:0px!important}html body iframe[name="google_ads_frame"]{width:100%!important;height:inherit!important;min-height:inherit!important}</style></div>


1
2
</div></div><p class="copyright"><strong></strong></p></div></div></div></div></div><script type="text/javascript">//<![CDATA[
fa_endpage();//]]>



Llevo muchas horas puliendo el código, y ya no avanzo más, agradecería cualquier ayuda.

GRACIAS!!
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

Fondo aleatorio alineación bloque

Publicado por Micky (2 intervenciones) el 01/06/2012 15:25:48
La alineación de bloque la conseguí! Pero el fondo aleatorio aún no...
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