0

Hi there new to css and there is something I don t understand for example

div.img img
  {
  display:inline;
  margin:3px;
  border:1px solid #ffffff;
  }

what does the other img represent, what is this? I understand that the class called img is going to be applyed on the div tag in the html body but what is the other img?? is this like a recursion in programming something inside something?

Edited by castajiz_2: none

2
Contributors
3
Replies
16
Views
3 Years
Discussion Span
Last Post by JorgeM
2

What this selector means is that you are going to select an image element that is within a div element that has been assigned a class called "img". So for example, this is the image element that would be selected...

<body>
  <div class="img">
    <img src="#" alt="image" height="50" width="50" />
  </div>
</body>
0

o thanks, i dont know why w3c schools did not mention this kind of thing and by the way how is this syntax called?

1

i dont know why w3c schools did not mention this kind of thing

W3Schools is great for a beginners, simple overview. The site has some mistakes, but most importantly, that site should not be confused with the W3C.

and by the way how is this syntax called

Its just known as "Seletors". Selectors may range from simple element names to more complex representations. Take a look at this article on the W3C site that goes into Selectors in much more detail. This article covers CSS3.

http://www.w3.org/TR/css3-selectors/

Votes + Comments
man, you re the best!
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.