How to insert anchors for my page?

Asked

Viewed 74 times

0

I have a page called noticias.html with several news items divided into several articles, but only the links of that part written "CONTINUE READING..." that I would like to have the news opened 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>

inserir a descrição da imagem aqui

  • When you say "the news opened all", you mean you want this container to expand its size, or you want the news to open on another page?

  • I think she’d better open another page ...

  • @Gustavosampaio would like some help on that part. I see on many news sites but I don’t know how and it works that someone please help me

  • what the standard used by the news sites ?

  • type that http://valemaisnoticias.com.br/category/mutuipe/ ?

  • 1

    <a target="_blank" href="link_da_notícia.html">CONTINUE LENDO...</a>

  • @Sam as I do to open the news on a new page more with a size that does not occupy 100% of the page ?

  • @hugocsl as I do to open the news on a new page more with a size that does not occupy 100% of the page ?

  • @jonassouza this would be a "new question" and it would not be possible to answer you everything in a comment. I suggest you open a New Question, then you put the code of how you will want to present the news and only this way will give to help you in a correct way and that will meet you 100%

Show 4 more comments

1 answer

1

If your button CONTINUE READING... is an element <a>, just add the attributehref, directing to the news page in question, as @hugocsl said. Already if it is an element <button>, you can add the attribute onclick, so that when the button is clicked, the page of the news in question is opened, through the declaration exemplified by @Otaviocapel, or through the method open, also belonging to the object window, as follows:

Open the news in another tab

window.open('link_da_noticia');

or

Opens the news in the same tab

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

This all considering that you want to open the news on another page.

What is the standard used by news sites?

Telling the example you provided, with two more examples I searched, I think their default is to open the news on another page, but in the same tab.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.