I am not in any way a graphic designer or a website designer and I have a website design case in which I have no idea how to proceed.
I have a website built with the Drupal CMS or framework and its core theme Olivero.
The Olivero theme is based on the grid CSS command and I think it makes design very hard for non designers because layout is dynamic at least by screen size and content amount in the webpage itself.
I am very reluctant to change the Olivero theme Twig-CSS source code because it’s very complex and start messing with it as a non website designer can cause broad mistakes.
In one of the webpages, I have putted an image at the top of the webpage to give some “style” to the webpage.
In mobile devices it looks fine but in desktop devices the image looks very large, so large that one might have to scroll down to view the small text right underneath it.
Here is an example of how I need to scroll down on my desktop computer with Microsoft Windows 11 Home, and a plain window of Google Chrome:
Above the fold look of the webpage:
Under the fold look of the webpage:
My problem
My problem is that it looks too large to me and I fear that in larger desktop screens it will look even larger and worse due to the nature of the CSS grid layout of the Olivero theme.
How to style top images in css-grid-based websites?
-
I can make the image a 50% width side image, but in this particular webpage I don’t want a side image, I want a 100% width image.
-
The following command pattern made the image to look awful, very squeezed:
@media screen and (min-width: 999px) {
.myImg {
max-height: 500px;
}
}
- The following command pattern cropped the image nicely but caused other top images to appear strange.
@media screen and (min-width: 999px) {
.myImg {
object-position: top;
object-fit: cover;
width: 100%;
height: 400px;
}
}
What else can I do?
If there was some CSS artificial intelligence rescaling tool it could have helped me, as it was rescaling the image too look sharp on max-height
of 250px
to 500px
, but as of today I don’t know any such tool.
Cropping and compressing each top image with an image manipulation tool like GIMP is not something I want to do because I have several similar top images and I don’t want to start manage their versions (uncropped and cropped) in folders.
A whole different approach
If I have to keep top images so “big and tall” so they’ll look sharp and not pixelated, at least in desktop devices, then maybe I should find a whole other approach here.
Maybe I should use JavaScript somehow to print the image alt text or the image mouse hover title text on top of the center of the image.
Maybe I should do something totally different.
In your opinion, what should I do in this case?