3 replies [Last post]
google@ildw.com
google@ildw.com's picture
User offline. Last seen 13 weeks 4 hours ago. Offline
rank Enthusiast
Enthusiast
Timezone: GMT-6
Joined: 2006-10-17
Posts: 114
Points: 19

I bought bullet proof web design 2nd edition and there is this code that I need some explanation:

what is the difference between:

#sweden dl dd.img
 
 
and
 
 
#sweden dd.img img

aren't they acting on the same image??? the difference is only the specificity? why?

the html code is the following:

<div id="sweden">
<dl>
	<dt>Stockholm</dt>
    <dd class="img"><img src="IMAGES/bolivia1.jpg" width="80" height="52" alt="bolivia 1" /></dd>
    <dd>This was taken in Gamla SThis was take</dd>
</dl>
</div>

Thanks

Tony
Tony's picture
User offline. Last seen 3 hours 16 min ago. Offline
rank Moderator
Moderator
Timezone: GMT+10
Joined: 2003-03-12
Posts: 3705
Points: 1115

Actually the first one is

Actually the first one is targeting the dd with the class of img which contains the image.
The second is targeting the image within.

Your question may have already been answered, search and read before you ask.

google@ildw.com
google@ildw.com's picture
User offline. Last seen 13 weeks 4 hours ago. Offline
rank Enthusiast
Enthusiast
Timezone: GMT-6
Joined: 2006-10-17
Posts: 114
Points: 19

targeting

wouldn't be the same image? I am confused Sad

Verschwindende
Verschwindende's picture
User offline. Last seen 6 days 3 hours ago. Offline
rank Guru
Guru
Timezone: GMT-5
Joined: 2009-10-09
Posts: 2037
Points: 2256

google@ildw.com

google@ildw.com wrote:

wouldn't be the same image? I am confused Sad

No. As Tony mentioned the first targets a <dd class="img"> and the second targets an <img>.

yet again.