XF 2.0 Text Width on in the message

Mackeral_Fillet

Well-known member
Hi,

Is it possible to change the text width within a message?

So for example, the below boxes become margins (or indents) both left a right of the text so I have white space either side to create an improved reading layout? The text would have images above and below, I find it is easier on the eye with some white space.

Screen Shot 2018-03-30 at 14.14.39.webp
 
Adding something like...

CSS:
@media (min-width: @xf-responsiveWide) {

    .message-body  {

        margin: 10px 100px;

    }

}

...to extra.less would probably do it. 100px is the width of the margins if you wanted to change it. The above would only trigger on larger screen sizes.

EDIT: That will add the margin to either side of the image though as well, if that's part of the post.
 
Cool - that's what I'm trying to avoid!
You're trying to avoid adding the margin to the image?

You could do it with a custom BBCode then. Call it [margin] or whatever.

Add something like this to the HTML replacement box when creating the new bbcode...

HTML:
<div class="text-margin">
    {text}
</div>

Update the code from my first post in your extra.less file to be...

CSS:
@media (min-width: @xf-responsiveWide) {

    .text-margin  {

        margin: 0 100px;

    }

}

Then in your post wrap the text under the image in your new [margin] bbcode.
 
Top Bottom