What does the following css selector display?

span#a p.fld
amuktaAsked:
Who is Participating?
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.

Shinesh PremrajanEngineering ManagerCommented:
This is what the CSS denotes

span#a p.fld{
   font-weight:bold;
   background:pink;
}

<span id="a"><p class="fld">This is Test</p></span>


Hope this helps
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
JuamezCommented:
Yeah, just as shinug explains by using an example:

SPAN and P are HTML-tags.
"#" means the ID of the tag and "." means the class of the tag.
What follows the "#" and "." are the ID and CLASS itself.

Also because p.fld is standing right of span#a with only a whitespace between them, it denotes the fact that all P-tags of class "fld" that are a child of span with ID "a" of an arbitrary generation (doesn't have to be the first generation child) are selected.

So, the css selector would apply also on this example:

<span id="a"><span class="ex1"><p class="fld">This is Test</p></span></span>

Even if P.fld isn't a direct child of SPAN#a, but SPAN#a is still an ancestor of P.fd.
0
amuktaAuthor Commented:
HI! Shinug,

So, does this display the text between <p></p> tags...which is in our example, This is test?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

JuamezCommented:
What do you mean by that question?
0
Shinesh PremrajanEngineering ManagerCommented:
Css is use for the text formatting and the design layout of the page.

The example depicted above is used to just show how is the tag is referenced

the below tag as such used is invalid, so i had written an example for how to use the css for a tag.

span#a p.fld

The above sequence is actually used to identify the tag in a css.

Hope this helps..
0
amuktaAuthor Commented:
Thank you for the detailed explanation!!!
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.