CSS | toda la propiedad

La propiedad all en CSS es la propiedad abreviada que se usa para establecer todos los valores de los elementos en sus valores iniciales o heredados o, en algunos casos, se usa para establecer los valores en otro origen de hoja de cálculo. Esta propiedad se usa para restablecer todas las propiedades CSS en un documento.

Sintaxis: 

all: initial|inherit|unset|revert|revert-layer;

Valor por defecto: Su valor por defecto es ninguno.

Valores de propiedad:  
inicial: esta propiedad se utiliza para establecer todas las propiedades en su valor predeterminado. 
 

  • Sintaxis: 
     
all: initial;
  • Ejemplo: 
     

html

<!DOCTYPE html>
<html>
    <head>
        <title>
            CSS all property
        </title>
         
        <!-- CSS all property -->
        <style>
            h1, h3 {
                background-color: yellow;
                color: green;
                all: initial;
            }
            body {
                text-align: center;
                all: initial;
            }
        </style>
    </head>
     
    <body>
        <h1>GeeksforGeeks</h1>
        <h3>all property</h3>
    </body>
</html>                   
  • Producción: 
     
GeeksforGeeks all property
  •  
  • Sintaxis: 
     
all: inherit;
  • Ejemplo: 
     

html

<!DOCTYPE html>
<html>
    <head>
        <title>All Property</title>
        <style>
            div {
                text-align:center;
                color:green;
                all:initial
            }
            h1, h3 {
                all: inherit;
            }
        </style>
    </head>
    <body>
        <div>
            <h1>GeeksforGeeks</h1>
            <h3>all property</h3>
        </div>
    </body>
</html>                   
  • Producción: 
     
GeeksforGeeks all property
  •  
  • Sintaxis: 
     
all: unset;
  • Ejemplo: 
     

html

<!DOCTYPE html>
<html>
    <head>
        <title>
            CSS all property
        </title>
         
        <style>
            h1, h3 {
                background-color: green;
                color: white;
                all: unset;
            }
            body {
                text-align: center;
                all: unset;
            }
        </style>
    </head>
     
    <body>
        <h1>GeeksforGeeks</h1>
        <h3>all property</h3>
    </body>
</html>                   
  • Producción: 
     
GeeksforGeeks all property
  •  
  • Sintaxis: 
     
all: revert;
  • Ejemplo: 
     

html

<!DOCTYPE html>
<html>
    <head>
        <title>
            CSS all property
        </title>
         
        <style>
            h1, h3 {
                background-color: yellow;
                color: green;
                all: revert;
 
            }
            body {
                text-align: center;
                all: revert;
            }
        </style>
    </head>
     
    <body>
        <h1>GeeksforGeeks</h1>
        <h3>all Property</h3>
    </body>
</html>                   
  • Producción: 
     

navegador compatible para ejecutar código CSS todas las propiedades:

  • cromo 37.0
  • Firefox 27.0
  • Ópera 24.0
  • Safari 9.1
  • Microsoft Edge 79.0

Publicación traducida automáticamente

Artículo escrito por DannanaManoj y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *