Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!