Skip to content

Help for displaying image and text differently on desktop and mobile #92

Open
@yannrapaport

Description

@yannrapaport

Hi,

I am new to HTML and CSS.

I am trying to build a homepage on shopify using the Brooklyn theme which takes advantage of your grid framework.

I would like to have 4 sections with an image and some text each, appearing as follows on a desktop:

img1 | text1
text2 | img2
img3 | text3
text4 | img4

and as follows on mobile:

text1
img1
text2
img2
text3
img3
text4
img4

I have tried to use push and pull classes without success. Here is my code:

<div class="grid">
    <div class="grid__item one-half push--medium--one-half push--large--one-half small--one-whole">
    <p>text1</p>
    </div>
    <div class="grid__item one-half pull--medium--one-half pull--large--one-half small--one-whole">
        <img src="/path/to/img1"/>
    </div>
</div>
<div class="grid">
   <div class="grid__item one-half small--one-whole">
        <p>text2</p>
    </div>
    <div class="grid__item one-half small--one-whole">
        <img src="/path/to/img2"/>
    </div>
</div>

With this code, text1 and img1 both appear overlapping on the right half of the screen... It works well with text2 and img2, likely because they appear in the same order as in the HTML...

Am I missing something?

Thanks in advance for your help!

Yann

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions