Place buttons in vertical html

1

How could I put these buttons one below the other in the form of a list?

a greeting

 <div id="f2c1">
                <button onclick="newBiblioteca()">Nueva Biblioteca</button>
                <button onclick="">Modificar Biblioteca</button>
                <button onclick="">Borrar Biblioteca</button>
                <button onclick="">Buscar Biblioteca</button>
                <button onclick="">Listar Bibliotecas</button>
            </div>
    
asked by Eduardo 04.11.2017 в 15:26
source

2 answers

2

You can do it with a list.

<div id="f2c1" style="list-style-type:none;">
 <li>
      <ul><button onclick="newBiblioteca()">Nueva Biblioteca</button></ul>
      <ul><button onclick="">Modificar Biblioteca</button></ul>
      <ul><button onclick="">Borrar Biblioteca</button></ul>
      <ul><button onclick="">Buscar Biblioteca</button></ul>
      <ul><button onclick="">Listar Bibliotecas</button></ul>
 </li>
</div>
    
answered by 04.11.2017 / 15:34
source
2

You can imagine that each botton is an element ul in the list and apply display: block to be aligned in block (one below the other);

button {
  display: block
}
<div id="f2c1">
  <button onclick="newBiblioteca()">Nueva Biblioteca</button>
  <button onclick="">Modificar Biblioteca</button>
  <button onclick="">Borrar Biblioteca</button>
  <button onclick="">Buscar Biblioteca</button>
  <button onclick="">Listar Bibliotecas</button>
</div>
    
answered by 04.11.2017 в 15:36