0

On this site, if I inspect "What We Do", I see the HTML code:

<a title="What we do – Mad Hat Media" href="http://test.doig.com.au/MHM/services/" class="sf-with-ul">What We Do<span class="sf-sub-indicator"> »</span></a>

with CSS code:

.menu li a .sf-sub-indicator, .menu li li a .sf-sub-indicator, .menu li li li a .sf-sub-indicator {
    background: none;
    content: '&raquo;';
    color: #622C82;
}

I can't see why the content: '&raquo;' does not display. The CSS element has a width and a colour.

What is missing are the drop down indicators (indicated by the green arrows in the screen shot below)

enter image description here

Help appreciated.

2
  • Make sure that you are using the UTF-8 character set. Commented Jan 16, 2017 at 6:01
  • 3
    content is an attribute for pseudoelements ::after and ::before, not for plain css selectors Commented Jan 16, 2017 at 6:02

3 Answers 3

1

I guess you should have a look at this class

.menu li a .sf-sub-indicator,
.menu li li a .sf-sub-indicator,
.menu li li li a .sf-sub-indicator {
    background: url(images/arrow-down.png) no-repeat;
    height: 16px;
    position: absolute;
    right: 5px;
    text-indent: -9999px;
    top: 13px;
    width: 16px;
}

the text-indent property causes the >> to go AWOL. Remove that and you are kinda set. You may have to toggle other classes though.

As for the drop down indicators, they are very much present, just remove the background:none

On that note, content property is usually set to ::before and ::after pseudoelement. Do have a look into this mdn link .

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I ended up replacing the default dropdown arrow that had been hidden with .menu li a .sf-sub-indicator, .menu li li a .sf-sub-indicator, .menu li li li a .sf-sub-indicator { background: url(images/arrow-right2.png) no-repeat; }
1

As I can see in your code selectors .menu li a .sf-sub-indicator, .menu li li a .sf-sub-indicator, .menu li li li a .sf-sub-indicator look almost equal.

Anyway if you want implement content attribute it's better to write something like:

.sf-sub-indicator::after {
    background: none;
    content: '&raquo;';
    color: #622C82;
}

https://i.sstatic.net/L55HS.jpg

2 Comments

Thanks Banzay. I've made that change, and the content appears in the HTML, but it does not display visually.
this works: .menu li a .sf-sub-indicator::after, .menu li li a .sf-sub-indicator, .menu li li li a .sf-sub-indicator { background: none; content: '&raquo;'; color: #622C82; }
0

Background image is set for this span. Inspect it again:

.menu li a .sf-sub-indicator, .menu li li a .sf-sub-indicator, .menu li li li a .sf-sub-indicator {
background: url(images/arrow-right2.png) no-repeat;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.