Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/07/2005, 05:47
Spyn_ET
 
Fecha de Ingreso: diciembre-2003
Mensajes: 218
Antigüedad: 20 años, 4 meses
Puntos: 0
Problemas con bordes redondeados

Buenas, antes de nada no estoy seguro si esto debe estar aki o en CSS, q algun moderador lo mueva si cree conveniente.

Os comento, resulta q me he hecho una clase para crear tablas redondeadas usando div y css, el problema es cuando decido crear una dentro de otra, eso me produce q la secundaria sobresalga sobre la principal.

Alguien sabe por q puede ser?¿

Esta es la clase

class-bordesRedondos.php
Código PHP:
<?

class bordesRedondos
{

    var 
$bgColor;
    var 
$fontColor;
    
    var 
$bkColor;
    var 
$id;

    
    
//Constructor
    
function bordesRedondos($name,$bgColor='#ffffc0'$fontColor='#000000'$fondo='#FFF')
    {
        
$this->bgColor $bgColor;
        
$this->fontColor $fontColor;
        
$this->id $name."_";
        
$this->bkColor $fondo;
    }

    function 
Cabecera()
    {
        
$salida ="<style type=\"text/css\">";
        
$salida .="div.".$this->id."rounded-box {position:relative;width: 9em;background-color: ".$this->bgColor.";margin: 3px;}";
        
$salida .="div.".$this->id."top-left-corner, div.".$this->id."bottom-left-corner, div.".$this->id."top-right-corner, div.".$this->id."bottom-right-corner
                    {position:absolute; width:20px; height:20px; background-color:"
.$this->bkColor."; overflow:hidden;}";

        
$salida .="div.".$this->id."top-left-inside, div.".$this->id."bottom-left-inside, div.".$this->id."top-right-inside, div.".$this->id."bottom-right-inside 
                {position:absolute; font-size:150px; font-family:arial; color:"
.$this->bgColor."; line-height: 40px;}";

        
$salida .="div.".$this->id."top-left-corner { top:0px; left:0px;}
                   div."
.$this->id."bottom-left-corner {bottom:0px; left:0px}
                   div."
.$this->id."top-right-corner {top:0px; right:0px;}
                   div."
.$this->id."bottom-right-corner {bottom: 0px; right:0px;}
                   div."
.$this->id."top-left-inside {left:-8px;}
                   div."
.$this->id."bottom-left-inside {left:-8px; top:-17px;}
                   div."
.$this->id."top-right-inside {left:-25px;}
                   div."
.$this->id."bottom-right-inside {left:-25px; top:-17px;}";

        
$salida .="div.".$this->id."box-contents {position: relative; padding: 8px; color:".$this->fontColor.";}";
        
$salida .="</style>";
        return 
$salida;
    }
    
//Funcion q muestra la tabla
    
function muestra($content '')
    {
        
$salida $this->Cabecera();
        
$salida .= "<div class=\"".$this->id."rounded-box\">
                    <div class=\""
.$this->id."top-left-corner\"><div class=\"".$this->id."top-left-inside\">&bull;</div></div>
                    <div class=\""
.$this->id."bottom-left-corner\"><div class=\"".$this->id."bottom-left-inside\">&bull;</div></div>
                    <div class=\""
.$this->id."top-right-corner\"><div class=\"".$this->id."top-right-inside\">&bull;</div></div>
                    <div class=\""
.$this->id."bottom-right-corner\"><div class=\"".$this->id."bottom-right-inside\">&bull;</div></div>
                    <div class=\""
.$this->id."box-contents\"align=\"center\">".$content."</div>
                </div>"
;
        return 
$salida;
    }
}
?>

index.php
Código PHP:
<?
include ("includes/class-bordesRedondos.php");

$tbl = new bordesRedondos('principal','#ffc0c0');

$tbl2 = new bordesRedondos('dos','#c0ffc0','#FFFFFF','#ffc0c0');
$content "<hr>";
$new $tbl2->muestra($content);
echo 
$tbl->muestra($new);

?>
__________________
SymbianForever
SymbianForever.com, todo sobre y para tu symbian
aNieto2K | Themes para WordPress
De todo un poco