Additional BBCodes: gallery and text alignment

Overview of the changes to the forum
Post Reply
User avatar
Selene310187
Site Admin
Joined: Fri Oct 07, 2022 8:34 pm
Contact:

Additional BBCodes: gallery and text alignment

Post by Selene310187 »

Gallery BBCode

Attached images can be shown side by side using the gallery or gallery2 BBCodes. The two column layout of the gallery will be shown if the screen width of your device is greater than 1100 pixels.

Code: Select all

[gallery][attachment=0]your_image.jpg[/attachment]...[/gallery]
(works with IMG BBCode as well)

Example:
287627-1627691041.jpg
287627-1614471629.jpg
287627-1635896827.jpg
287627-1633832956.jpg
(shown are my Fallout 4 characters Sam (the one with the grey skin) and Charly)


Positioning of the gallery is possible using the gallery2 BBCode.

Code: Select all

[gallery2=center][attachment=0]your_image.jpg[/attachment]...[/gallery2]
All options: left, right, center




Text alignment BBCode

You can align the text with the align BBCode.

Code: Select all

[align=center]text[/align]
All options: left, right, center, justify

Example (CSS style: "text-align: center"):
Text


Combined with gallery2 (CSS style: "justify-content: center"):

287627-1627691041.jpg
287627-1614471629.jpg
287627-1635896827.jpg
287627-1633832956.jpg
User avatar
Selene310187
Site Admin
Joined: Fri Oct 07, 2022 8:34 pm
Contact:

Re: Additional BBCodes: gallery and text alignment

Post by Selene310187 »

I fixed the appearance of the gallery on mobile devices. The two column layout will be shown if the screen width of your device is greater than 1100 pixels.


Here's the CSS code snippet regarding the layout for different screen sizes:

Code: Select all

@media screen and (max-width: 1100px) {
  .bbgallery {
    grid-template-columns: 404px!important;
  }
}

@media screen and (max-width: 465px) {
  .bbgallery {
    display:block!important;
  }
}

Further reading:
CSS @media rule
CSS display property
CSS !important Property
Grid layout
Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “Information & Announcements”