Shop Mobile More Submit  Join Login

PE: A Guide to Gallery CSS

Thu Jul 4, 2013, 9:35 AM


A Guide to Gallery CSS

Learn the basics of Gallery CSS with this easy-to-follow guide! :dummy:

In this tutorial, we'll cover:



Adding Gallery CSS

First of all, some important facts about Gallery Skins:

  • Only Premium Members are allowed to add CSS to their galleries
  • Skins can be added to both the Gallery and the Favorites
  • Skins can only be added to the Gallery folders and Favorites collections (shown in the sidebar) but not the main page itself

Step 1: Click on one of your Gallery or Favorites folders in the sidebar.


Pick a Folder by SimplySilent

Step 2: Click the button called "Folder Options" or "Collection Options."

This button is located at the top right of the gallery.

Button by SimplySilent

Step 3: Click on the blue "CSS" link at the top of the box.

Then click on the link called "Add CSS..." and then click the "OK" button on the pop-up box. You'll end up with a white text box like the one shown below.

Css by SimplySilent

Step 4: Paste your CSS into the box and click "OK" to save.

Your CSS will automatically be added to the folder.


Coding Your Own Gallery Skins

Step 1: Understand the basic layout.

In this tutorial, we'll focus only on the three main parts of the gallery layout: the body, the folder title, and the description. Now don't worry, I promise that it'll be easier than you think! In the pop-up box that you get after you click "Folder Options" or "Collection Options," you are shown several options.

  • Name: Folder Title
  • Text: Description
  • Text Placement: Where your description goes. See the images below to see how these two formats look:

Box by SimplySilent

Here's what you get if you select "Left" for your text-placement:

Folder Layout by SimplySilent

And here's what you get if you select "Right" for your text-placement:

Right by SimplySilent

Please note how I have color-coded the three different parts of a gallery layout.

  • body (blue) covers the entire gallery folder
  • h2 (pink) contains the folder title
  • .description (yellow) contains the folder description

In this tutorial, we'll be working with the Left format, since that is the default option.

Step 2: Changing backgrounds and text colors

The first thing you'll probably want to do is change the colors of the backgrounds and text. Here's the basic format you can copy and edit:

body{
background:#color; }

h2{
background:#color;
color:#color; }

.description{
background:#color;
color:#color; }


For example, say I wanted a light gray background (#f1f1f1) for the body with a dark blue background for the folder title (h2) and description (#213457). I would type the following code into the CSS text box:

body{
background:#f1f1f1;}

h2{
background:#213457;
color:#fff;}

.description{
background:#213457;
color:#fff;}

The result would look like this:

Gallery by SimplySilent

Step 3: Changing margins and padding


Notice how the formatting looks rather ugly in the preview above. There's a gap that I don't like above and to the left of the title, and the title is jammed right above to the image thumbs. The text of the title and description also look quite cramped, making them a bit difficult to read. But no worries, we'll fix those up nicely with margins and paddings!

:lightbulb: Remember: margin refers to the space outside of a box, while padding refers to the space inside of the box!

In the paragraph above, I complained about the gaps around the title box (h2). Since that is outside of the box, we'll be dealing with margin. I want less of a gap at the top and the left, while I want more of a gap at the bottom. In CSS talk, this translates to:

margin-top: -15px;
margin-left: -15px;
margin-bottom: 30px;

or, if you are more experienced, you can condense the above into just one simple line :la: :

margin: -15px 0px 30px -15px;


Now, I also didn't like how the text looked cramped in the title and description. Since this is inside the box, we'll work with padding.

For the title (h2), I want a padding of 30px all around, while for the description, I want a padding of 20px all around. In CSS talk, this would be:

padding: 30px;

and

padding: 20px;

Since we added padding to the description, this makes it become too large and start to squeeze into the image thumbs. To fix this, I'll limit the size of the description to a smaller size of 160px by adding:

width: 160px;

Now we get this much prettier result:

Gallery2 by SimplySilent

Putting it all together, the code looks like this:

body{
background: #f1f1f1;}

h2{
background: #213457;
color: #fff;
margin: -15px 0px 30px -15px;
padding: 30px;}

.description{
background: #213457;
color: #fff;
padding: 20px;
width: 160px;}


Step 4: Experiment!


For those who are more experienced with CSS, here are just a few of many elements you can use:

  • .folderview-art {} contains all the image thumbs
  • .tt-w {} contains the thumb, title, comments, and artist
  • .thumb {} formats the image thumbs
  • .details {} contains the title, comments, and artist
  • .details .t {} formats the thumb title
  • .details .u {} formats the artist
  • .commentcount {} formats comments

:lightbulb: Tip! Use display:none!important; to get rid of any element you don't want. For example, if you want to hide the comments, type .commentcount{display:none!important;}.

Adding Background Images:

If you prefer patterns or textures instead of solid blocks of color, then you can add background images with this code:

background: url('INSERT IMAGE LINK HERE');

For those with more experience with CSS, you can also work with background color, background repeat, and background position. You can combine all these into one line like so:

background: #color url('INSERT IMAGE LINK HERE') no-repeat top;

To learn about all of the different options you can use, I suggest reading about backgrounds on www.w3schools.com



Some Useful Resources

Tutorials/Layouts:


Gallery Skins:

Browse through Gallery Skins on deviantART.

Groups:

:iconecssited: :iconcss-dyk:




Learn the basics of gallery CSS with this easy-to-follow guide! In this tutorial, we'll cover:

1. Adding gallery CSS
2. Coding your own gallery skins
3. Some useful resources
Add a Comment:
 
:iconbbellab:
BBellaB Featured By Owner 4 days ago  Student Digital Artist
Um excuse me, but I don't see that button in my gallery/favorites page. 
So....... I am like -.-
Reply
:iconry0on:
RY0on Featured By Owner Aug 20, 2015  Student Digital Artist
Where do we place this code      background: #color url('INSERT IMAGE LINK HERE') no-repeat top;     because when I place it on the very begginign of the css code it wont work.
Reply
:iconlittletinyrichhome:
LittleTinyRichHome Featured By Owner Jul 27, 2015  Hobbyist General Artist
Thank you for this!!!!!
Reply
:iconplatinasi:
PlatinaSi Featured By Owner Jul 13, 2015  Hobbyist Digital Artist
I'm not sure if this is just me, but gallery CSS seems to have stopped working? Any sort of CSS on gallery skins for both Gallery and Favorites have been disabled and image embedding/thumbs won't work in the description area either;; Do you think it's part of the thumbnail makeover dA is planning in the near future?
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Jul 14, 2015
They're still working for me: simplysilent.deviantart.com/fa…

The gallery system is quite a bit different than what's in the journal, which is unfortunately rather outdated now. Skins still seem to be working though. :)
Reply
:iconplatinasi:
PlatinaSi Featured By Owner Jul 14, 2015  Hobbyist Digital Artist
Ahh yeah, they seemed to have come back to normal after a few hours- I think it was a temporary bug, thank goodness :'D thanks for the reply, though!♡
Reply
:iconyunasenpai:
YunaSenpai Featured By Owner Jul 13, 2015  Hobbyist Digital Artist
Omg I thought I was the only one.
I tried to install a css template, it kept not working at all :'(
Reply
:iconplatinasi:
PlatinaSi Featured By Owner Jul 13, 2015  Hobbyist Digital Artist
Whew, so I guess it's not a problem on my side! It sucks for them to not work at all, doesn't it;; I hope whatever DA is planning to do for profiles/galleries in the near future is something worth all this trouble!
Reply
:iconyunasenpai:
YunaSenpai Featured By Owner Jul 13, 2015  Hobbyist Digital Artist
Yeah I'm reassured now that I'm not the only one too. xD
That kinda sucks yeah ><, I hope we'll got news soon though
Reply
:iconzoehana:
ZoeHana Featured By Owner Jul 5, 2015  Student Filmographer
For some reason I cannot get the Gallery title to change colors.  I know the past I could, but recently nothing I have tried works.  Did they change the coding or did start limiting what we can do with Galleries now?
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Jul 7, 2015
Have you tried adding !important?

It's been a while since I've worked on gallery coding, so I can't be sure what the issue is. It might just be that we are limited. :hmm:
Reply
:iconzoehana:
ZoeHana Featured By Owner Jul 7, 2015  Student Filmographer
Yeah I was able to change it before.  I am thinking they have limited us.
Reply
:iconfrozen-space:
frozen-space Featured By Owner Jun 18, 2015  Professional General Artist
I have a question, why in gallery Featured I can't change CSS? 
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Jul 7, 2015
Just a DA thing, I'm afraid.
Reply
:iconmaximumdoodie:
MaximumDoodie Featured By Owner Jun 7, 2015  Hobbyist Digital Artist
Thank you so much this is extremely helpful!
except I can't figure out how to change the title to be blue like yours ono it just stays with a black font ;___;
Reply
:iconastralkarma:
AstralKarma Featured By Owner Jun 6, 2015  Student General Artist
Let's say I'm using this background:  Sweet Cream Gallery Skin by Ninelyn

This bg image doesn't cover the full body, and leaves the body behind the description the normal DA color (greenish-gray.) Is there a way to spread that image (the hearts) to behind the description? Or a way to fill the area behind the description with a color?  If there's a specific way to code that, where would it go?

If you need the coding for the bg, lemme know. I can note you..
Reply
:icono0msk0o:
o0MSK0o Featured By Owner Jun 4, 2015
is this all up-to-date?
some things don't work :O
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Jun 5, 2015
Ehh, might be a bit out of date. I think I fixed some of my own journal skins after a DA updated a while back, but this might not have made it.

I hope to someday go back and update all my tutorials, but I'm not sure when that'll happen.
Reply
:iconsheeppoops:
SheepPoops Featured By Owner Apr 13, 2015  Student Digital Artist
I cant figure out how to put a background ;A;
I put the code in there, and replace the words, not the ' or ( and paste a background url.

Am I supposed to leave the Background colour? or am I supposed to remove it? D:
Reply
:iconcolors-of-summer:
Colors-Of-Summer Featured By Owner Edited May 24, 2015  Hobbyist General Artist
To add an image that's in your stash:
CSS Coding
body {
    background-image: url("insertURLhere.lol");
}
Simply replacing ' with " may help. Make sure you're getting the right link for your picture location, try putting your picture in your Sta.sh if you haven't already.
HTML Coding
<img src="url" alt="text for if the image wont display"AAA>
Add in
style="width:YYYpx;height:YYYpx"
to replace 'AAA' to define the size of your picture in pixels. replace 'YYY' with the size.

This is just from basic HTML coding. Sometimes DeviantArt doesn't like that though and wont display things correctly. If you have any troubles, don't be afraid to note me and I cant give you/explain other ways to do it too. Hope this helps!! d(0v0)b


Sorry for all the 'it may help' stuff. I haven't really gone all out with these codes on dA yet xD
Reply
:iconsheeppoops:
SheepPoops Featured By Owner May 25, 2015  Student Digital Artist
omg thankyou ;A; !
Reply
:iconcolors-of-summer:
Colors-Of-Summer Featured By Owner May 25, 2015  Hobbyist General Artist
You're welcome! ヾ(❀╹◡╹)ノ゙
Reply
:iconopalartz:
OpalArtz Featured By Owner Mar 29, 2015
very useful and informative!! thank you very much!!
Reply
:icontheghin:
TheGhin Featured By Owner Mar 7, 2015  Hobbyist Traditional Artist
hello loved the tutorial
which css code you used?

Step 4: Paste your CSS into the box and click "OK" to save.

Reply
:iconkawaii-nurse:
Kawaii-Nurse Featured By Owner Mar 1, 2015  Hobbyist General Artist
Thank you so much for making this!
Do you have on for journal skin CSS?
Reply
:iconkittykittyhunter:
kittykittyhunter Featured By Owner Feb 26, 2015   Writer
Thank you so much for putting this together! It's really helpful.
Reply
:icondrawingenatias:
DrawingEnatias Featured By Owner Feb 23, 2015   Digital Artist
Thanks so much, coming from a person who knows CSS for customization. this is very useful for customising my gallery and favourites. c:
Reply
:iconkojiana:
Kojiana Featured By Owner Feb 20, 2015
Thanks a lot. :thumbsup:
Reply
:iconmisterdoe:
misterdoe Featured By Owner Feb 18, 2015  Hobbyist Digital Artist
Great and useful tutorial. I hope to put it to work right away. :)

One little thing -- those anchor links to the different sections of this post all lead to blank Sta.sh documents... :|
Reply
:iconpromisedeclipse0988:
PromisedEclipse0988 Featured By Owner Dec 25, 2014  Hobbyist General Artist
Sorry never mind .u.'
Reply
:iconpromisedeclipse0988:
PromisedEclipse0988 Featured By Owner Dec 25, 2014  Hobbyist General Artist
How do i make the gallery folder pic in general change?
Reply
:iconensodancer:
EnsoDancer Featured By Owner Dec 23, 2014
What if I want to code a lit thumb in the description? I understand the basics of coding lit thumbs but how do I get to the ones within the description? I would at least like to take out the little blue journal icon. Thanks.
Reply
:iconcolors-of-summer:
Colors-Of-Summer Featured By Owner Edited May 24, 2015  Hobbyist General Artist
Just look in the +Add Media button where ever you can, find the emote you want and hover over it. for example, DeviantArt  is : deviantart : without spaces.
As for taking the image OUT of a box, like the custom box paper icon and such, the only one I'm aware of that works like that is the Journal. Basically you have to just not code it into your journal CSS.
Here's a nice place to customize a journal and see how the changes affect the journal:
www.simplydevio.us/resources/b…
And it's made by SimplySilent too! \(0w0)/
Reply
:iconsuirenhime:
SuirenHime Featured By Owner Dec 15, 2014  Hobbyist Digital Artist
This is SO helpful thank you ever so much for making this!

You have made mad scientist DA gallery CSS easy as pie! <3

(Also, I recommend adding other peoples problems and solutions
to your description, because I was having a few problems, but
by scrolling through others questions and answers, I got
everything to work out nwn)
Reply
:iconxxdreamdealerxx:
xxDreamDealerxx Featured By Owner Aug 23, 2014
I'm trying to figure out how to create translucent white boxes behind the thumb image/description with an opacity of 0.4
I pretty much got it, but the thumb image is translucent as well! I'm not sure how to fix this, could you please help? Thanks =^.^=
Reply
:iconcreator-kami:
Creator-Kami Featured By Owner Aug 21, 2014
I have a couple questions for you pertaining to Gallery CSS. I'd like to know how to manipulate the previous and next buttons and the page number buttons in the gallery. I'd like to remove the buttons if at all possible and leave just the text. 

Also, is there a way to recolor links? I've been having a hellish time with that.

Also is there anyway to incorporate the gallery subfolders into the CSS code?
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Aug 21, 2014
1. Eurg, I'll have to go in a see the code again, as I never modify those. If you know how to Inspect Element (right click on the page and select Inspect Element) you can examine the HTML for those buttons yourself. :D

2. Only in Chrome. In firefox, DA's code overwrites anything you might try.

3. No, not that I know of.
Reply
:iconcreator-kami:
Creator-Kami Featured By Owner Aug 21, 2014
1. Ooh thank you so much!

2. Yay, I use Chrome! Okay, how exactly do you do it?
Reply
:iconlittlegreencreatures:
LittleGreenCreatures Featured By Owner Aug 17, 2014  Hobbyist Traditional Artist
I still don't know how to add the background image ): It keeps saying it's invalid. 
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Aug 17, 2014
This guide needs major overhauling, but this should still do the trick:

body{
background: url('IMAGE URL');
}

Make sure you're using the image url correctly.
Reply
:iconlittlegreencreatures:
LittleGreenCreatures Featured By Owner Aug 17, 2014  Hobbyist Traditional Artist
wait but i did put the image url in the IMAGE URL section and it still pops out and says that it's invalid D: 
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Aug 17, 2014
Paste me  your Image URL. You might be using one that's not good for DA.
Reply
:iconlittlegreencreatures:
LittleGreenCreatures Featured By Owner Aug 17, 2014  Hobbyist Traditional Artist
www.themesltd.com/iphone/light…

it's the same one i used for my profile custom boxes 0: 
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Aug 17, 2014
Try:

body{background:url('http://www.themesltd.com/iphone/light_green_polka_dots.png')!important;}
Reply
:iconlittlegreencreatures:
LittleGreenCreatures Featured By Owner Aug 17, 2014  Hobbyist Traditional Artist
prntscr.com/4dv44w
this is what happens when i copy and pasted in ): 
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Aug 17, 2014
Are you putting that in the description box where the "Here are the sketches" part is? It should be in the CSS box.
Reply
(1 Reply)
:iconkittyface27:
kittyface27 Featured By Owner Jul 5, 2014  Hobbyist Digital Artist
what is a css? i understand how to do it once i have one, but i cant tell what the css is or looks like?? please help.
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Jul 5, 2014
CSS is a coding language. All the code in this journal is CSS. :)
Reply
:iconkittyface27:
kittyface27 Featured By Owner Jul 5, 2014  Hobbyist Digital Artist
im sorry, i still dont understand. what is the code in this journal? i just found about the css today and googleing what it is isnt helping me. sorry. :(
like what does it look like. is it a really long string of letters and symbols?
Reply
:iconsimplysilent:
SimplySilent Featured By Owner Jul 5, 2014
CSS looks like this:

body{
background:#color; }

h2{
background:#color;
color:#color; }

.description{
background:#color;
color:#color; }

All the code in the white boxes in the journal are CSS codes. :)
Reply
Add a Comment:
 
×

:iconsimplysilent: More from SimplySilent


Featured in Collections


More from DeviantArt



Details

Submitted on
July 4, 2013
Submitted with
Sta.sh Writer
Link
Thumb

Stats

Views
17,150 (5 today)
Favourites
883 (who?)
Comments
181
×