How do I insert anchors to my page?

0

I have a page called noticias.html with several news divided in several articles, but only the links of this part that is written "CONTINUE READING ..." I would like to make when clicking on this part the news will open all with the rest of the information

My code is this:

section {
  width: 80%;
  margin: 0 auto;
  background-color: #dedede;
}

article {
  width: 200px;
  height: 200px;
  background-color: yellow;
  display: inline-block;
  margin-left: 10px;
}

a {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 7px;
  text-decoration: none;
  background-color: red;
  display: table;
  position: relative;
  top: 150px;
}

h2 {
  width: 100px;
  height: 100px;
  border: 1px solid black;
}
<section>
  <article>Notícia 01
    <a href="">continue lendo...</a>
  </article>

  <article>Notícia 02
    <a href="">continue lendo...</a>
  </article>

  <article>Notícia 03
    <a href="">continue lendo...</a>
  </article>

  <article>Notícia 04
    <a href="">continue lendo...</a>
  </article>

</section>

    
asked by anonymous 12.12.2018 / 00:05

1 answer

1

If your CONTINUE READING ... button is a <a> element, just add the href attribute, pointing to the news page in question, depending on what @hugocsl said . If it is a <button> element, you can add the onclick attribute so that when the button is clicked, the news page in question is opened, through the declaration exemplified by @OtavioCapel, or through the open , also belonging to the object window , as follows:

Opens the news in another tab

window.open('link_da_noticia');

or

Opens the news on the same tab

window.open('link_da_noticia', '_self');

That's all considering that you want to open the news on another page.

  

What is the pattern used by news sites?

By telling the example you provided, with two other examples that I looked for, I think their pattern is to open the news on another page, but on the same tab.

    
12.12.2018 / 01:14