What does the following css selector display?

span#a p.fld
Who is Participating?
Shinesh PremrajanConnect With a Mentor Engineering ManagerCommented:
This is what the CSS denotes

span#a p.fld{

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

Hope this helps
JuamezConnect With a Mentor Commented:
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.
amuktaAuthor Commented:
HI! Shinug,

So, does this display the text between <p></p> tags...which is in our example, This is test?
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

JuamezConnect With a Mentor Commented:
What do you mean by that question?
Shinesh PremrajanConnect With a Mentor Engineering 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..
amuktaAuthor Commented:
Thank you for the detailed explanation!!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.