How to select all paragraphs on the HTML page whose title is "About Us"

I want to select all paragrahs on the HTML page whose title is "Contact Us".  It seems like
 
[title="Contact Us"] p {color:red; };

Open in new window

should work, but it doesn't .  Does anyone see the problem?

Thanks
stevaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
Format needs to be tag[attribute-selection].  See example below.

<!DOCTYPE html>
<html>
<head>
<style>
p[title="Contact Us"] {color:red;}
</style>
</head>
<body>
<p title="Contact Us">This is paragraph one.</p>
<p>This is paragraph two.</p>
<p title="Contact Us">This is paragraph three.</p>
</body>
</html>

Open in new window


»bp
0
stevaAuthor Commented:
This looks like a p that has a title attribute of "Contact Us".  But what I'm looking for is all the ps that are on the page that the title attribute of "Contact Us".
0
Bill PrewCommented:
This looks like a p that has a title attribute of "Contact Us".  But what I'm looking for is all the ps that are on the page that the title attribute of "Contact Us".

Sorry, it's still not clear to me what elements you are trying to style, can you provide an HTML sample?  How are you defining "pages" in the HTML document?


»bp
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

stevaAuthor Commented:
I'm adding custom CSS to a Squarespace site.  The CSS goes into an area that's global to the site.  If the page that's being viewed is "Contact Us" I want all the ps on that page to have this style.
0
Bill PrewCommented:
Can you send me a link to the "Contact Us" page of your site.


»bp
0
stevaAuthor Commented:
I found a way to do this.  Squarespace also allows me to add custom CSS to a particular page, so I'll just do that, and then only the ps there will be affected.

Thanks
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bill PrewCommented:
Great, glad you found a way to solve your need.


»bp
0
stevaAuthor Commented:
It was the only right answer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.