1 reply [Last post]
gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 45 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

OK CSS selectors .

Now if i have the below code in HTML

<div class="carousel-caption">
 
                <h1>Hello world</h1>
		<p>corp</p>
 
</div>

Now in CSS if i say

div p 

it will select p i assume.

and if i type

div > p

will it still select p ? or will i have to do

div > h1 > p

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 15 hours 32 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

"div p" says any p descended

"div p" says any p descended from div. It doesn't matter how many elements lie between them.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.