Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Single post in Coding Diaries

Forum Index > PokéFarm > Journals > Coding Diaries >

Aemilia's AvatarAemilia
Aemilia's Avatar
Columns example:
Apples
Bananas
Trees
Grass
An entire line needed here

Code

Columns example: [sc=columns][ ][sc=row][ ][sc=col-1]Apples[/sc][ ][sc=col-3]Bananas[/sc][ ][/sc][ ][sc=row][ ][sc=col-2]Trees[/sc][ ][sc=col-2]Grass[/sc][ ][/sc][ ][sc=row][ ][sc=col-4]An entire line needed here[/sc][ ][/sc][ ][/sc] [style] * { box-sizing: border-box; } .columns { [class*="col-"] { width: 100%; float: left; padding: 1%; margin-bottom: 0.75%; } @media only screen and (min-width: 768px) { .col-1 { width: 25%; } .col-2 { width: 50%; } .col-3 { width: 75%; } .col-4 { width: 100%; } } .row::after { content: ""; clear: both; display: table; } } [/style]
About the code: - You can use the same class multiple times! Do not mess with the CSS unless you understand what you're doing. - There are six classes: columns, which embodies the code and contains everything for it without affecting other parts of a post/template; row, which symbolises a row; col-1, a column with a width of 25% of the available space; col-2, a column with a width of 50% of the available space; col-3, a column with a width of 75% of the available space; and col-4, a column with a width of 100% of the available space. - Make sure each row equals exactly 100% maximum width of all columns combined. Excess forced a column onto a new line, while too little will create gaps at the end of the row. There can be a maximum of four columns in a row, all must be using the col-1 class. -- On mobile, all col- classes are 100% and will take up the whole width for mobile compatibility. Please take this into account when using the code. - Feel free to increase/decrease the padding as necessary, and add a border to the columns. The box-sizing property makes sure that the width includes the size of both in its calculations. - If you need more columns, create another col- class and then recalculate the widths. For example, if you have five columns, you'd need to set col-1 width to 1/5th of the available space, col-2 width to 2/5ths, col-3 width to 3/5ths, col-4 width to 4/5ths, and col-5 width to 5/5ths. - If you have other concerns, feel free to PM me on site or DM me on Discord
Kaede.php#1366
. Upon responses, if I feel there's a question often heard, I'll add it to this section of the post.
Buying: BSDs 20 ZC Prisms 70 ZC
Icons/Template by Aemilia

by Kaede

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page