How to handle fixed image widths for mobile screens
-
Hello,
in the Bento them, I am using the SiteOrigin Editor which I find quite appealing.
My customer wants the following section (1 cell, 1 row) to be fixed when scrolling some text – the text defined within the next section (1 cell, 2 rows):
<h1 style="font-size: 46px; font-weight: normal; color: gray; padding-top: 150px; padding-bottom: 100px;">HEADING</h1> <p style="text-align: right; padding-right: 0px; padding-bottom: 100px; margin-top: -200px;"> Some text </p> <img src="https://wherever.de/wp-content/uploads/2018/07/DSC4011-1024x681.jpg" alt="Text" width="600px" class="alignright size-full wp-image-481 bild" style="margin-top: 0px; margin-right: -110px;" />
Statically, everything looks nice for the customer.
But:
I need to differentiate between a desktop PC, an iPad and an iPhone layout. Which is okay, too, if it were not for the fact that I need to define the image’s size as in the code above (I do not see how to make it “responsive”).
What I need to do now is to differentiate the image size for the various displays.
The SiteOrigin Editor offers modifications for the desktop and the mobile CSS in separate data entry regions on the right hand side, but I do not see any different results.
Another option would be to make an entry into the additional CSS area, but I do not know how to address desktop and mobile layouts separately.
In the upper-mentioned image code, I have integrated “bild” so that I could add something like
.bild img { width:900px; } for the desktop and .bild img { width:600px; } for the mobile version.
Could such an approach, entering this code in the additional CSS area, be successful? If so, how to differentiate between a desktop and a mobile layout?
I hope I have made clear what I am looking for.
Best regards
Markus
- The topic ‘How to handle fixed image widths for mobile screens’ is closed to new replies.