Foros del Web » Creando para Internet » CSS »

Problemas con Div,float,capital leters

Estas en el tema de Problemas con Div,float,capital leters en el foro de CSS en Foros del Web. Saludos. Ando prácticando y aprendiendo a usar los div y css y hoy me pegue en una parte. La página es esta: http://www.napacrush.org/donations.php y como ...
  #1 (permalink)  
Antiguo 12/12/2008, 09:40
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Problemas con Div,float,capital leters

Saludos.

Ando prácticando y aprendiendo a usar los div y css y hoy me pegue en una parte.

La página es esta: http://www.napacrush.org/donations.php
y como pueden ver, trate de darle un efecto de letra capital y mediante los div ir corriendo la letra hacia la derecha.
casi que me salio bien,exepto que el texto que va despues de las leras con el efecto quedo abajisimo, esto en firefox, y en explorer 6, la letra capital ni se ve y me pone este error:
Cita:
When a margin is applied to a floated box on the same side as the direction of the float, the margin is doubled. This bug only affects the first float in a row of one or more floats.

Affects: Internet Explorer 6.0
Likelihood: Very Likely
y el texto tambien aparece abajo. Aqui pongo los códigos que estan trabajando ahi:

Código HTML:
<tr>
    <td colspan="28" style="background:#000000"  width="850"><div id="scroll" >
      <br>
      <br>
      <div id="divletracapitalc" class="parrafo">C<span class="style2">&nbsp;&nbsp;ommunity</span></div><br>
      <div id="divletracapitalc" class="parrafo">R<span class="style2">&nbsp;&nbsp;esources</span></div><br>
      <div id="divletracapitalc" class="parrafo">U<span class="style2">&nbsp;&nbsp;nited to</span></div><br>
      <div id="divletracapitalc" class="parrafo">S<span class="style2">&nbsp;&nbsp;erve</span></div><br>
      <div id="divletracapitalc" class="parrafo">H<span class="style2">&nbsp;&nbsp;umanity</span></div> 
      </div>
     <div class=""> <p class="style2">  Kids are at the mercy of those who care for them. It's just not right that some  kids are forced to grow up with little chance of the life they could have  because of economic strain; poor parenting decisions; lack of food, water, and  basic life necessities; political strife; and countless other obstacles that  block a kid's potential to thrive. </p>
  <p class="style2">We don't have to sit by idly and watch this happen indefinitely.</p>
  <p class="style2"> We can bring lasting change.</p>
  <p class="style2">We can CRUSH those obstacles that are hurting and in some cases killing the  next generation.</p>
  <p class="style2">Wine Country people know that &quot;the crush&quot; is a very important step in  the life of a future wine. Without, there is no wine! The crush is a very  exciting time to do very important work to make sure grapes have the chance to  become great wine. Lots of energy, time, people, and resources are required to  pull off the crush. If done well, it will result in a future wine that adds  something special to the everyday and not-so-everyday events.</p>
  <p class="style2">CRUSH exists to join like-minded people together to make sure there is a good  future for those children who are most vulnerable or at risk in our valley and  world. CRUSH means coming together to do what needs to be done to ensure a  bright future for kids who live under a cloud of despair.</p>
  <p class="style2">You can get involved right now. The funds for CRUSH are building, but  need help. Coat distribution is just seven months away. The average coat costs  around $20. Can you swing a coat or two or ten? Deborah's House needs ongoing  financial support as well to scholarship children to decent schools. They need  clothing and basic supplies for a healthy childhood. A few extra dollars goes a  long way. A trip to Kenya  is already in the works, where we hope to partner with existing grass-roots  projects to adopt an entire village within the slum to give children food,  water, clothing, medical supplies, and educational supplies. Many of the  guardians work an entire week for $1. You &quot;little&quot; goes a long way.</p>
  <p class="style2">If you want to support CRUSH with your hands and feet, we welcome you! Contact  us at <a href="mailto:[email protected]">[email protected]</a> to find out  how you can help Napa  kids, kids just across the border, and kids half a world away.</p>
  <p class="style2">Thanks for your interest in <span class="h2"></span><span class="h1">CRUSH!</span> Let's make a difference!</p>
  </div>
      <br />
    </td>
  </tr> 
CSS:
Código HTML:
@charset "iso-8859-1";
/* CSS Document */

.parrafo:first-letter{/*letra capital*/
	font-size:290%;
	color:#009999;
}
.style1{/*Titulo grande amarillo subrayado*/
	color:#FFC000;
	font-family:Tahoma;
	text-align:center;
	font-weight:bold;
	text-decoration:underline;
	font-size: 16px;
		}
.style2{ /*texto normal*/
	color:#FFFFFF;
	font-family:Tahoma;
	font-size:12px;
	text-align:justify;
	padding: 2px 2px 5px 5px;

#divletracapitalc{
	float:left;margin-left:90px;}

	

#scroll { 
	width:100%; 
	height:640px; 
	background-color:#000000; 
	overflow:auto; 
}
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
  #2 (permalink)  
Antiguo 12/12/2008, 10:15
Colaborador
 
Fecha de Ingreso: junio-2007
Mensajes: 5.798
Antigüedad: 16 años, 10 meses
Puntos: 539
Respuesta: Problemas con Div,float,capital leters

Puedes utilizar la propiedad first-letter
Cita:
.divletracapitalc p:first-letter {float:left;
font-family:/*la elegida^/;
font-size:/*la que necesites*/;
font-weight:bold;
line-height:0.8em;
text-transform:uppercase;
}
incluye si necesitas el letter-spacing para separar la distancia de la letra capital a la siguiente
__________________
Por una web con mucho estilo
+++ CUENTA ABANDONADA. ¿la quieres? +++
  #3 (permalink)  
Antiguo 12/12/2008, 10:40
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Respuesta: Problemas con Div,float,capital leters

Cita:
Iniciado por kseso? Ver Mensaje
Puedes utilizar la propiedad first-letter

incluye si necesitas el letter-spacing para separar la distancia de la letra capital a la siguiente
Hola Kseso?

Bueno, ya no se corre el texto hasta abajo, pero no me esta aplicando el efecto de las letras ni corre los textos a la derecha. Me quedo así:
CSS:
Código HTML:
.divletracapital p:first-letter {
	float:left;
	color:#009966;
	font-family:Tahoma;
	font-size:290%;
	font-weight:bold;
	line-height:0.8em;
	text-transform:uppercase;
}
HTML
Código HTML:
 <tr>
    <td colspan="28" style="background:#000000"  width="850"><div id="scroll" > <br>
        <br>
        <div class="divletracapital">C<span class="style2">&nbsp;&nbsp;ommunity</span></div>
        <br>
        <div class="divletracapital">R<span class="style2">&nbsp;&nbsp;esources</span></div>
        <br>
        <div class="divletracapital">U<span class="style2">&nbsp;&nbsp;nited to</span></div>
        <br>
        <div class="divletracapital">S<span class="style2">&nbsp;&nbsp;erve</span></div>
        <br>
        <div class="divletracapital">H<span class="style2">&nbsp;&nbsp;umanity</span></div>
      
      <div> 
y en explorer, aunq cierro el div, le aplica un efecto a la primera letra de todos los parrafos.
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
  #4 (permalink)  
Antiguo 12/12/2008, 10:53
Avatar de SPAWN3000  
Fecha de Ingreso: marzo-2008
Ubicación: Bogota
Mensajes: 858
Antigüedad: 16 años, 1 mes
Puntos: 15
Respuesta: Problemas con Div,float,capital leters

Bueno, no digo que tu practica este mal... pero no seria mas facil si:

creas:

/*Aquí determinas las características de tamaño y posición*/
#contenedor{
width:100%;
height:300px;
text-align:left;
left:10px;
top:50px;
...
color:#fff;
}
/*Aquí las características de la letra*/
#contenedor span{
color:#336666;
font-family:Tahoma;
text-align:center;
font-weight:bold;
font-size: 18px;
/*Deduzco que sea probable que debas cambiar la propiedad top*/
top:-2px; /*No se, habria que probar*/
left:-5px; /*No se cuanto debe correr, con valores de ejemplo*/
}

/*Luego el html*/
<div id="contenedor">
<span>H</span>ola, esto es una prueba...
</div>

/*Abria que probar a ver que resulta de esto*/

Última edición por SPAWN3000; 12/12/2008 a las 10:59
  #5 (permalink)  
Antiguo 12/12/2008, 11:37
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Respuesta: Problemas con Div,float,capital leters

Bueno, traveseando un poco tu código Spawn3000 ya casi le llego al efecto, solo tengo que buscar algunos parametros y ver porque no reconoce el tipo de letra que le puse, pero ya casi esta:
http://www.napacrush.org/donations.php

De hecho lo único que te falto fue el float:left
Código HTML:
#contenedor{
width:20%;
height:300px;
text-align:left;
left:10px;
top:10px;
color:#FFFFFF;
float:left;
Todo lo demás esta trabajando (excepto lo de la letra, debería se tahoma y no la agarra). Gracias a ambos.
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
  #6 (permalink)  
Antiguo 12/12/2008, 11:49
Avatar de SPAWN3000  
Fecha de Ingreso: marzo-2008
Ubicación: Bogota
Mensajes: 858
Antigüedad: 16 años, 1 mes
Puntos: 15
Respuesta: Problemas con Div,float,capital leters

Ahora que lo pienso mejor, esto podría ser mas fácil con una lista... y una clase que este incrementado la posición de forma heterogénea.

Claro, tu lo deseas con div... pero lo anterior podria ahorrar código.
  #7 (permalink)  
Antiguo 12/12/2008, 11:55
Avatar de gVenom  
Fecha de Ingreso: julio-2008
Ubicación: Costa Rica
Mensajes: 1.458
Antigüedad: 15 años, 9 meses
Puntos: 53
Sonrisa Respuesta: Problemas con Div,float,capital leters

Cita:
Iniciado por SPAWN3000 Ver Mensaje
Ahora que lo pienso mejor, esto podría ser mas fácil con una lista... y una clase que este incrementado la posición de forma heterogénea.

Claro, tu lo deseas con div... pero lo anterior podria ahorrar código.
Bueno no es que lo desee con divs, lo que pasa es que estoy buscando practicar para no usar tablas, así que hice un td grande para buscar posicionar mi contenido ahi sin un montón de <td> por todo lado, y lo único que se me ocurrió fue lo de los div, pero no los domino. Apenas estoy dándoles.
__________________
"Al que venciere y guardare mis obras hasta el fin, yo le daré autoridad sobre las naciones."
Apocalipsis 2: 26
Servicios para Pymes http://dst.co.cr
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:21.