0

I am looking for a way to change the hyperlink for Node title on a view. So far have tried rewriting the Node title field and also tried a global text field but links still show as blue.

Tried this but did not work:

<a href="{{ view content }}" style="color: #cc0000">{{ Node Title }}</a>

What is the best way to change link color in views?

1
  • 1
    What output are you getting from that code? It must be something in your syntax or Views concepts. Inline styles should work, even though that isn' the proper way (to mix content and presentation). – prkos Sep 28 '18 at 22:25
1

The correct way to style websites is with CSS.

You can use a selector from the existing Views output, or you can assign a special class to your Content: Title Field under Style settings. You can Create a CSS class for the field wrapper or the HTML element.

Then use the class selector in your CSS inside the theme:

.my-class a {
  color: #cc0000;
}

If you're not creating your own (sub)theme and only want to make minor adjustments you can use the CSS Editor or CSS Injector modules.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.