Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8950587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:29:00+00:00 2026-06-15T13:29:00+00:00

I have a very strange problem. I have got a Rails page in which

  • 0

I have a very strange problem. I have got a Rails page in which I want to use CSS to format all links, and there are menu links which should have another color. So I started out with

    .menulink:link, .menulink:visited, .menulink:hover, .menulink:active{
        color: red;
    }

in the menubar fragment CSS (sidebar.css.scss)

For all other links, I wrote CSS into application.css.scss:

    a:link, a:visited, a:hover, a:active{
        color: green;
    }

Interestingly, this does not work. BUT if I add a class tag to any link in my code, like so

    <%= link_to "Alle Artikel", :controller => :articles, :action => :index, :class => "foo" %>

it works perfectly. I really am confused. Why this behaviour?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:29:01+00:00Added an answer on June 15, 2026 at 1:29 pm

    I suspect you may be seeing the ‘cascading’ in Cascading Style Sheets.
    Basically it seems that when you place a specific class selector the class gets applied. That’s the rule with css, the more specific the rule the more it will apply any higher level ‘global’ settings.
    So when you apply the rule at a higher general level such as all anchors, what may be happening is that there are style rules at lower levels than “all anchors” but at a higher level than the class/tag and this may help explain the behavior you are seeing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a very strange problem. I've got a rails app in which I
I've got a very strange problem recently. I have a code which processes inApp
I got very strange problem. I have one php website which is running in
I have a very strange problem in which identical pieces of Javascript are behaving
I use the memcache extension for python, and I have a very strange problem.
I have got a very, very strange problem in my C++ OpenGL application. I
I have a very strange problem in an ASP.NET page, the following reference of
Afternoon all, I have a very strange problem. When VS 2012 is open, compile
I've got a very strange problem here: There is a RESTfull web service on
I have got problem with django's UserCreationForm. It's very strange because ween I: view:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.