Commit 2d770d02 by Georgina Mondino

Borrador Crear Botones

1 parent 59c2777c
<html>
<body>
<input type="number" id="CantBotones">
<button onclick="AgregarTabs()">Generar Tabs</button>
<section id="BotonesContainer" >
</section>
</body>
<script>
function AgregarTabs() {
let m = document.getElementById("CantBotones").value;
let n;
for (n = 0; n < m; n++) {
let padre = document.getElementById("BotonesContainer");
let boton = document.createElement("Button");
padre.appendChild(boton);
boton.setAttribute("id", "Boton" + n);
boton.setAttribute("class", "Botones");
boton.addEventListener("click", HabilitarTab);
boton.style.width = ((100-(0.2*m))/ m) + "%";
}
}
function HabilitarTab(){
}
</script>
<style>
#BotonesContainer {
width: 100%;
height: 95%;
}
.Botones {
border-radius: 5px 5px 0px 0px;
background-color: grey;
border:none;
height: 5%;
margin: 0.1%;
}
.Botones:active{
background-color: whitesmoke;
border-bottom: none;
height: 6%;
border: 1px solid rgb(189, 189, 189);
border-bottom: none;
}
.Botones:hover{
background-color: rgb(53,53,53), 0.5;
}
</style>
</html>
\ No newline at end of file
......@@ -76,8 +76,8 @@ body {
.NewTabButton {
font-size: 45px;
width: 90px;
height: 90px;
width: 70px;
height: 70px;
border: 3px solid rgb(0, 88, 170);
background-color: rgb(0, 102, 255);
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!