CSS link to another web

Hello all,
I have just a possibly silly question…
as in html you make a link with

<a href="web"> 

is it possible to do the same with CSS?


Repl link:

Could you please tell us more on what you would like to do? Mabye as an answer to your question I do believe that CSS is only for styling.


Creating a link with css is not possible concerning what I found on the web.


Yes, that’s what I thought, only for styles.
I had a little tiny bit of hope to be possible to do it.
I will post the code and see what to do.

1 Like

Hi @footroot72 !
I actually believe this is possible. You’ll need to do this:
I believe this works (it goes in the link tag).

I don’t think so. You can create things like “pseudo-element” to fake the appearance of an link.

There’s no motive to CSS reference links. Also, why? CSS is mainly for styling and presentation, not for creating or handling behavior.


No, you can’t make links in CSS. Here, I can explain what each type of file/language is for:

  • HTML:
    • To MAKE elements (buttons, text, etc.)
  • CSS:
    • To "style" those buttons (add color, animations, etc.)
  • JS (JavaScript):
    • Add action and events (e.g. show text when a button is pressed)

So, they each have their own task. HTML is how you make elements, such as links, while CSS is how you can give them color, vibrance, and animation. So you can’t really “make” a link with CSS, to my knowledge.

Possibly to consolidate code or something? (Though I feel like having the different languages makes it more organized)