Panneau N0C 04 EN 250 250
Get 15% discount on our partner PlanetHoster with the code PHA-ceikay

How to have certain blocks limited in width?

More
7 months 3 weeks ago - 7 months 2 weeks ago #76273 by agnoletti
Hello Sir,
I want side space on a wide screen but not on a mobile device + I want the columns with content to stay in the center of the column and not on the left.
Is there a smarter way than putting empty columns right and left as I have done in the editor? Maybe putting some code in the "user.css" file?
I have attached a screenshot from the back-end to show the only solution I got working so far.
Thank you!
 
 
Last edit: 7 months 2 weeks ago by agnoletti. Reason: Put [SOLVED] in the subject

Please Log in or Create an account to join the conversation.

More
7 months 3 weeks ago #76297 by ced1870
Hi
Interesting request. May be that I would use the external margins on the block/column with % values.
Then you can also update these values in responsive mode to give smaller values, or zero to disable them

Not sure if this is what you need
CEd

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

More
7 months 2 weeks ago #76334 by agnoletti
I came to the desired result putting the following custom CSS code provided by ChatGPT in the text block, as shown in the attached screenshot:

 

& {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

& > *,
& .inner,
& .cktype {
    max-width: 400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    & {
        max-width: calc(100% - 40px);
        margin-left: 20px;
        margin-right: 20px;
    }

    & > *,
    & .inner,
    & .cktype {
        max-width: 100% !important;
    }
}

Please Log in or Create an account to join the conversation.

More
7 months 2 weeks ago #76337 by ced1870
thank you for sharing the solution

Joomlack Webmaster and Developer

Please Log in or Create an account to join the conversation.

Time to create page: 0.186 seconds

Fast and powerful creation, customizable and responsive.

Read More

We have 2606 guests and 3 members online