Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda