HOME | DD

Dediggefedde β€” 3 Column CSS snippet

#collumns #css #deviantart #journal #journalcss
Published: 2014-09-23 22:11:17 +0000 UTC; Views: 2814; Favourites: 32; Downloads: 0
Redirect to original
Description About: this is a basic 3-column-layout using display:inline-block and relative block-sizes.
Someone asked me in a note to fill the blank space left and right of a thumb which was centeres in a journal with text.
When using is, don't write blanks/new lines between and the following

as this blank/new line will also be shown between the columns.
As the CSS is pretty simple I just mention the vertical-align-property: it sets how a div is vertically aligned to it's neighbor text/div elements. "top" will align the top-lines, bottom the bottom-lines, middle will vertically center this element. it doesn't affect the div's content.


HTML::

this is a test.
If you see this, I made the mistake of submitting.

This should be the first collumn. e.g. Requests are open:

Isn't that a nice thumb? well, I'm just writing random text, so I can see this example... Well... what else to say... I just hope this text will preceed the normal text-height of this row, so you/I can see the overflow-behavior.



CSS::

.firstColumn{width:20%;display:inline-block;text-align:right;vertical-align: top;}
.secondColumn{width:50%;display:inline-block;text-align:center;vertical-align: top;}
.thirdColumn{width:20%;display:inline-block;text-align:left;vertical-align: top;}


Edit: For Non-Core members there is a nice description here:
www.deviantart.com/simplysilen…


Summary:
Two-Column way:

70% Text
30% Text

You can change -70 in the class name to one out of 70, 65, 60, 35. switch -ll and -rr to switch column sizes left and right. Leave out the split-x part to get 50%
To make 3 columns, nest them:

32.5% Text
32.5% Text
35% Text

Related content
Comments: 10

Jack-the-Shinigami [2019-03-27 22:04:12 +0000 UTC]

This isn't working for me (probably bc it was posted a long time ago).
I'm not sure if you're still active, but do you have any new, working code to make 3 collumns?

πŸ‘: 0 ⏩: 1

Dediggefedde In reply to Jack-the-Shinigami [2019-04-04 22:48:41 +0000 UTC]

Hi! I still try to maintain all my scripts and codes.

However, I have some phases where I just stay away from deviantart for a year or two occassionally.

luckily I get e-mail notifications about comments.


I think you need to have a core membership in order to use it.

Otherwise custom classes and custom CSS wouldn't work.

Also because of dA's whitelist tag system, there is little that can be done.

Best bet would be to scan through dA code, identify an element that has some floating CSS properties and grab it's class name for the journal... though that will also most likly look ugly. ^^


If you have tried it with a core membership account, please tell me.

πŸ‘: 0 ⏩: 1

Jack-the-Shinigami In reply to Dediggefedde [2019-04-05 05:04:45 +0000 UTC]

I didn't find a way to make 3-parted columns, but I found one to make 4 (without core). xD
I put two 50/50 column codes into the columns of one 50/50 column code.
Resulting in 25/25/25/25.

Here's the result, because that probably explains it better then what I just said:

Intro Jack

The top line is still outside of the columns.
The two outer side lines are column 1 & 4 and in between, in column 3&4 I split up text and pictures.
It's a bit restricted size-wise, but it worked for what I was trying.

Thanks for your help, tho!

πŸ‘: 0 ⏩: 1

Dediggefedde In reply to Jack-the-Shinigami [2019-05-06 19:54:02 +0000 UTC]

Did you see this solution?

In principle you can make a 50% column division inside the 70% column division to get a 35%-35%-30%.

An example would be:

UntitledLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dol

πŸ‘: 0 ⏩: 1

Jack-the-Shinigami In reply to Dediggefedde [2019-05-06 21:54:56 +0000 UTC]

Yep. Thanks, that's exactly what I was using as well. XD
But I needed 4 columns and I couldn't make any other sizes then 4 x 25% work with that concept above somehow. Idk why maybe less than 25% is too small or something? Meh. But I think the way it turned out is fine anyway.

πŸ‘: 0 ⏩: 1

Dediggefedde In reply to Jack-the-Shinigami [2019-05-07 17:31:41 +0000 UTC]

There might be a misunderstanding about how the code works.


Non-core users cannot use custom CSS, but they can use classes for their div tags.

These tricks utilize classes that are already used somewhere in DeviantArt's page layout.


For example, if you look at the code of the "submit comment" button, you see
< a class="smbutton smbutton-green comment-submit smbutton-big post" > Submit Comment

if you want a green button in your journal, then you can use the code (without blanks around the < >)


However, this means you can only use existing classes.

Simply changing the number in the class name does not change the width in the CSS code.

In this case, the CSS is listed here: st.deviantart.net/css/devianta…
Somewhere in the middle, it says

.mods-hh.split-70 .mods-column-ll{width:70%}.mods-hh.split-70 .mods-column-rr{width:30%}.mods-hh.split-65 .mods-column-ll{width:65%}.mods-hh.split-65 .mods-column-rr{width:35%}.mods-hh.split-60 .mods-column-ll{width:60%}.mods-hh.split-60 .mods-column-rr{width:40%}.mods-hh.split-35 .mods-column-ll{width:35%}.mods-hh.split-35 .mods-column-rr{width:65%}

There you can see, that only 70%, 65%, 60%, 35% are available for .mods-hh.split-. 50% can be done by leaving the class out, since it's the default.

πŸ‘: 0 ⏩: 1

Jack-the-Shinigami In reply to Dediggefedde [2019-05-07 21:22:23 +0000 UTC]

OHH! Omg, thank you so much, I didn't know that (or didn't realize all the details until now) but a lot of stuff makes sense now! I'll try to figure out how to change the column-codes I used to different sizes with this new knowledge. 🌻🌼🌻🌼🌻🌼 Again, thank you SO much!

πŸ‘: 0 ⏩: 0

SingingFlames [2014-09-24 20:04:31 +0000 UTC]

Excellent!

πŸ‘: 0 ⏩: 0

Shoofly58 [2014-09-24 13:20:47 +0000 UTC]

This works with no problems. I did change the first column to text-align:left; instead of right, and added some padding values to each column. The thumb in the middle column is centered perfect when viewing from the profile page. Now I have lots of room on the right and left to add text which shortens my journal. Perfect! Thanks
I'll be using this in the future as well.

πŸ‘: 0 ⏩: 0

UszatyArbuz [2014-09-24 07:40:49 +0000 UTC]

Very useful! Thank you

πŸ‘: 0 ⏩: 0