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

Well my question title says it all and is that correct to do ?

I am not talk 100% simantically , you always can't be 100% semantic i understand , but is code like the below correct :

                       <figure class="services-figure">
                            <span class="services-icon accident">
 
                            </span>
                            <figcaption>
                                <h4>Accident-Trauma Center</h4>
                                <p>Joint replacement came to 
                                    stay in the 60s and 70s and 
                                    it is now a common 
                                    operation. It is safe, 
                                    effective ...</p>
                            </figcaption>
                        </figure>

or is it absolutly wrong ?

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 31 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

Quote: you always can't be

Quote:

you always can't be 100% semantic

Why not? And if not, you'd best have compelling reason to screw it up.

Where is the figure you're captioning? The bg image in the span? Wrong. A bg image is decoration, not content.

<figure class="services-figure">
  <img src="some.jpg" 
       alt="short description of the image">
 
  <figcaption>
    Accident-Trauma Center
  </figcaption>
 
  <p>Joint replacement came to stay in the 60s and 
     70s and it is now a common operation. It safe, 
     effective …
  </p>
</figure>

See the figure and figcaption elements.

It can be argued that the img element should be wrapped in a p element. I think that is the more structurally sound method.

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.