Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 13d 00h 45m 02s
Claim 50% off
Solved Templates

changing article margins on mobile

Asked by YUMA SCOTT 2 years ago Last activity 2 years ago

Can someone help me with the coding needed to change the margins or whatever I need to make an article show up larger in mobile?
All margins are too large and it makes the image and text too small to read on mobile.

Please see attached image for reference.
https://prnt.sc/wVbA99XIx-dU

Accepted answer

Marked as the solution
Paul Frankowski Senior Staff
2 years ago · edited

Hi Scott,

  1. Thanks @Pavel, indeed it should help. Becuase by default there is 70px of padding, set by webmaster (?) of that site in Template Options > Custom CSS. It means that somebody forgot that that value is also used for Mobile view ;]

  2. Think also about SEO & Accessibility - using only image in articles for example "Relaxing Your Wrist" is far too few, even Google suggests a minimum of 300 words. ! I mean, you need text under the image(s).

  3. Improve also visibility and size of offcanvas toggler icon [=] by using

#offcanvas-toggler > i { color: #333;font-size: 26px; }

5 more replies

Pavel

Hi.

Use media queries in your code.

For example

@media (max-width: 767.98px) {
    .view-article article.item {
        padding: 0 30px 30px 30px;
    }
}
YUMA SCOTT Asked this

Thanks guys, appreciate your help!

By the way, my first name is Yuma :)

YUMA SCOTT Asked this

OK, so here's what I found, if I remove the 70px padding that was mentioned, and add the code that Pavel suggested, it looks good on mobile, but no longer looks good on desktop.
See image here:
https://prnt.sc/XbFg27RX-ibI

How can I make them look good on both? Is there a auto width or something?

Paul Frankowski Senior Staff

Yuma,

please learn more about CSS, also what is @media for, then you will know How to use it.
Becuase you can keep both codes (old & new one).

There so many CSS guides... that I don't have to repeat them here.

Log in to reply.