pool matho
pool matho

Reputation: 39

CSS combined attribute selector

I'm working on a class in which I need to translate a PSD to HTML/CSS, and I've been trying to select something but I'm not even sure it's possible, I want to select the links in a div with the id="topbar".

Here is what I tried:

div[id="topbar"] p{
    text-decoration: none;
    font-color:white;
}

It doesn't seem to work, but is it because this is impossible or am I just missing something?

this is what the HTML part should look like:

    <div id="topbar">
        <p><a>Agent Login</a></p>
        <p><a>Customer Login</a></p>
        <p>Not a member ? <a class="colorlink">Register</a></p> 
        <p>Call us now: 815-123-4567</p>
    </div>

Upvotes: 0

Views: 66

Answers (1)

Fabrizio Calderan
Fabrizio Calderan

Reputation: 123418

if you need to select the links then your selector should be

[id="topbar"] a {
  text-decoration: none;
  color:white;
}

(currently you're selecting all the paragraphs). Also note that:

  • the property font-color doesn't exist: use color instead
  • the selector doesn't need to be overly specific and the element can be omitted

Upvotes: 2

Related Questions