show dbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ejemplo1</title> | |
<style> | |
h1 { | |
text-align: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sintaxis | |
if (condicion) { | |
// código que se ejecuta si la condición es verdadera | |
} else { | |
// código que se ejecuta si la condición es falsa | |
} | |
//Ejemplo: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Sintaxis: | |
if (condicion) { | |
// código que se ejecuta si la condición es verdadera | |
} | |
//Ejemplo: | |
function miFuncion(edad) { | |
console.log("Bienvenido"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let nombreFuncion = () => { | |
//código | |
} | |
// Los parámetros siguen estando entre paréntesis, esta vez antes de la flecha (function). | |
let nombreFuncion = (importe) => { | |
console.log("total", importe) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFuncion() { | |
return 3 + 4; //sentencia. “return” me devuelve el valor calculado | |
} | |
//invocación: | |
myFuncion(); // 7 | |
//Utilizando parámetros: | |
function myFuncion(a, b) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function nombre_de_la_funcion(parametro1, parametro2) { | |
// código (sentencias) | |
} | |
//Para invocar: | |
nombre_de_la_funcion(argumento1, argumento2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS link</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<h1>Hola mundo</h1> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Declaración de estilos</title> | |
</head> | |
<body> | |
<h1 style="background-color: yellow"></h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ejemplo css</title> | |
<style> | |
h1{ | |
color:red | |
} | |
</style> |
NewerOlder