5
Well I know we can make links by directing the click href
for a page id 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>
This way every time you click he’s going to the top 0 px
, 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 the 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 some way of producing that ?
Either you create a larger padding-top in the elements with CSS or you use Javascript (jQuery).
– LeAndrade
@Leandrade not necessarily... with CSS and way to solve
– hugocsl
So I was thinking here, there really is @hugocsl. I think in his case it would be better just CSS anyway. Put it there, if you don’t fix it for him I’ll put one with Js.
– LeAndrade
@Leandrade of good, it is not a very elegant technique, but it solves... Tmj JS tb is rss option, even more if it is without jQuery =)
– hugocsl
@hugocsl Jewel man.
– LeAndrade