开发者

HTML5 Force a relationship between two separate elements

开发者 https://www.devze.com 2023-03-14 11:04 出处:网络
I am trying to use HTML5s best practices but have the following dilemma. I have a series of images and text that related to each other but because of an application of a 开发者_运维技巧jQuery transiti

I am trying to use HTML5s best practices but have the following dilemma. I have a series of images and text that related to each other but because of an application of a 开发者_运维技巧jQuery transition to cycle through them I have had to separate the image from its coinciding text. So rather than ideally looking like this:

<article>
    <img src="image1.png">
    <h1>Title1</h1>
    <p>Description</p>
</article>
<article>
    <img src="image2.png">
    <h1>Title2</h1>
    <p>Description</p>
</article>

Instead it looks like this:

<div id="textholder">
    <article>
        <h1>Title1</h1>
        <p>Description</p>
    </article>
    <article>
        <h1>Title2</h1>
        <p>Description</p>
    </article>
</div>
<div id="images">
    <article>
        <h1>Title1</h1>
    </article>
    <article>
        <h1>Title2</h1>
    </article>
</div>

This is obviously not ideal because there is now no relationship between the image and the text. I am gauging this relationship through HTML5 outliner (h5o). Is there a way of linking a relationship between to separated tags?


No. Rewrite the jQuery script, your original HTML is the semantically correct way to do it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号