mirror of
https://gitlab.com/tutorial-java-rafa-munoz/tutorial-java-2024-25/LMSGI-2024-25.git
synced 2025-11-09 18:03:06 +01:00
20 lines
695 B
HTML
20 lines
695 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<script>
|
|
function cambiarTamanio(factor) {
|
|
let parrafo = document.getElementById("texto");
|
|
let tamañoActual = window.getComputedStyle(parrafo).fontSize;
|
|
let nuevoTamaño = parseFloat(tamañoActual) + factor;
|
|
parrafo.style.fontSize = nuevoTamaño + "px";
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<p id="texto" style="font-size: 16px;">Este es un texto con tamaño ajustable.</p>
|
|
<button onclick="cambiarTamanio(2)">Aumentar tamaño</button>
|
|
<button onclick="cambiarTamanio(-2)">Disminuir tamaño</button>
|
|
</body>
|
|
</html>
|