2 replies [Last post]
barleytwist
barleytwist's picture
User offline. Last seen 1 year 24 weeks ago. Offline
rank Regular
Regular
Timezone: GMT+1
Joined: 2008-06-29
Posts: 23
Points: 3

I have this html:

<div id="first">
<form name="adminForm" .....>
<p>....</p>

I want CSS to target the p as display:none and need to use those three elements. I have tried:

#first adminForm p{display:none;} but that doesn't work.

Any advice?

--------------------
Thanks for your time

Hugo
Hugo's picture
User offline. Last seen 6 hours 51 min ago. Offline
rank Moderator
Moderator
Joined: 2004-06-06
Posts: 15096
Points: 2191

There's no such element as

There's no such element as 'adminForm' did you mean to add a '#' or '.' to it? Other than that you need to read the posting guidelines as their isn't enough info.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
User offline. Last seen 3 hours 26 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8123
Points: 1302

Use the adjacent sibling selector

#first form + p { display: none }

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference