I know that we can make links by directing click href
to an id of the page using #
.
#content1, #content2, #content3, #content4 {
height: 50vh;
border: 1px solid red;
}
<a href="#content1"> CONTEUDO 1</a>
<a href="#content2"> CONTEUDO 2</a>
<a href="#content3"> CONTEUDO 3</a>
<a href="#content4"> CONTEUDO 4</a>
<div id="content1" class="content1">CONTEUDO 1 TEXTO</div>
<div id="content2" class="content1">CONTEUDO 2 TEXTO</div>
<div id="content3" class="content1">CONTEUDO 3 TEXTO</div>
<div id="content4" class="content1">CONTEUDO 4 TEXTO</div>
In this way everytime you click it, you are going to top 0 px
, you would have some way of sending it to a different top, because depending on what you have at the top, it will cut a piece of text.
So the ideal would be to change this top 0, for example to top 5, face click on the link it leads to the top - 5.
Would you have any way to produce this?