Additional BBCodes: gallery and text alignment

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
View more smilies
Smilies
:sn-1: :sn-2: :sn-3: :sn-4: :sn-5: :sn-6: :sn-7: :sn-8: :sn-9: :sn-10: :sn-11: :sn-12: :sn-13: :sn-14: :sn-15: :sn-16: :sn-17: :sn-18: :sn-19: :sn-20: :sn-21: :sn-22: :sn-23: :sn-24: :sn-25: :sn-26: :sn-27: :sn-28: :sn-29: :sn-30: :sn-31: :sn-32: :sn-33: :sn-34: :sn-35: :sn-36: :sn-37: :D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
View more smilies

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review

I accept the Privacy policy.

   
  • Saved at

Expand view Topic review: Additional BBCodes: gallery and text alignment

Re: Additional BBCodes: gallery and text alignment

by Selene310187 » Wed Nov 16, 2022 10:17 am

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

Additional BBCodes: gallery and text alignment

by Selene310187 » Wed Nov 16, 2022 2:10 am

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-1635896827.jpg
287627-1614471629.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-1635896827.jpg
287627-1614471629.jpg
287627-1633832956.jpg

Top