Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
When building a website with html, and css. Is it possible to create a link to another page with Css alone?

When building a website with HTML, and CSS. Is it possible to create a link to another page with CSS alone?. To be more specific, I don't want to use an anchor tag with HTML.

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

No — CSS stands for 'Cascading Style Sheets', It does not provide anything other than styling. You CAN create a link without an A-tag though with Javascript, like this:

// Define your 'link' element
const el = document.getElementById('not-link-element');

// Define your target URL
const href = 'www.url-here.com';

// When your element is clicked, navigate to your target URL
el.addEventListener('click', function () {                  
  window.location.href = href;  
}); 

That said, I highly, highly discourage it and can't see any use case where you'd have a clickable link but wouldn't use an A-tag, so proceed with caution.

about 4 years ago · Juan Pablo Isaza Relatório

0

It's not possible, as CSS is a styling language. To write content you would need HTML, a markup language.

If you don't want to use HTML directly, you could use JavaScript, a high-level programming language that can manipulate the DOM (Document Object Model). One way to do it is using the write() method, which you can reference here: https://www.w3schools.com/jsref/met_doc_write.asp.

about 4 years ago · Juan Pablo Isaza Relatório

0

For do that I recommend to you use an tag

<a href="https://www.w3schools.com">Visit W3Schools.com!</a>

Then you could add to it some css style using a class for example

<a href="https://www.w3schools.com" class="yourCssClass">Visit W3Schools.com!</a>

Then you could define the style at the css class.

.yourCssClass {
    color:blue;
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda