Posted by Tserin Teaches You Den CSS

✷ Tserin (#2230)

Prophet
View Forum Posts


Posted on
2016-01-01 22:03:39

THIS THREAD IS VERY LONG AND HAS A LOT OF CODE.

ALRIGHT KITTENS time to learn how to CSS code your den. It's not scary or even that difficult once you've gotten used to the whole process, I promise. In this thread I'm going to walk you through how I code CSS layouts. This means that there may be some "unnecessary" coding and that you could do it another way faster/more cleanly, but that's not how I do it. This is also going to be a fairly basic guide without anything particularly fancy or advanced.

FIRST OFF. Things you'll need.


  • Something you can write in and save things as .css files with. Doesn't have to be anything fancy. I literally just use notepad.

  • A Dropbox account with a public folder or a Google Drive account. That's what you're going to use to host your CSS file so you can link it to your den.

  • At least a vague idea of what you want your den to look like. It doesn't matter if you're just gonna change it the next day or make several layouts to use. My side account has five different ones. What matters is you have some idea of what you want.
  • A site you can get hexcodes from. Hexcodes are what we use to color things, so they're pretty important. I use ColorPicker, though Paletton is also quite nice.

  • PATIENCE. This is probably self-explanatory.

SECOND. Things I recommend.


  • A list of fonts. If you're going to change fonts, then obviously you'll need to know what options you have. Here's a list of fonts that don't need any extra work for most people to see, and here are fonts that will need an additional CSS code (it gets given to you, don't worry!) to work.

  • Some basic coding knowledge. You don't need to know anything about coding, but it does help if you already know some CSS, or even know some HTML.

  • Music to listen to. If that helps you, that is. It honestly helps me a lot. If you find you're having trouble concentrating, try listening to video game soundtracks. They're designed to keep you engaged in what you're doing, so it might help a bit.

  • W3Schools' CSS section!! It has a lot of info and can definitely help you learn.


There are also some things I don't recommend.


  • FONTS THAT ARE NOT EASILY READABLE BY MOST PEOPLE. This includes some cursive fonts and bold fonts. Lobster is a popular choice that can be difficult to read sometimes.

  • Also fonts that I do not recommend that don't really fall into the above categories are Papyrus and Tangerine. Both have to be made rather large to be easily readable, which ends up making boxes bigger, which in my opinion looks quite bad. Tangerine is worse with this than Papyrus. Papyrus personally offends me, though.

  • LOTS OF BRIGHT COLORS. A blinding den is NOT a good thing to have.

  • Font colors that are very similar or almost the same to the background color. Dark grey text on a darker grey or even black background, for example. This also makes it difficult to read.

  • Animated backgrounds. Really fucking distracting.

Now, shall we get started?



The first thing I'm going to do when I decide to make a layout is to open notepad (or another program that can be used for this purpose) so I can actually write the code. Then, I'm going to figure out what I want the background to be. I think I just want a solid color, so I'll grab a hex code from ColorPicker (a shade of blue sounds nice right now) and do this,

body {
background: #113145 !important;
}


That will give me a nice blue background. To quickly go over what exactly this is doing,
body tells the browser what part of the page we're changing,
background: tells the browser what about the body we're changing,
#113145 tells the browser what color to change the background of the body to.
{ and } show where the code for what we're changing about the body begins and where it ends. You need to include these, otherwise your code will not work.
The ; at the end shows where the code for what we're doing to the background of the body ends. Again, you need to include these for your code to work.
!important is a way to force your custom CSS to work. You need it for some areas, however I just add it to everything so I don't have to remember what needs to have an !important tag and what doesn't. Feel free to experiment.
All future codes will be made up in a very similar way, and should be mostly self-explanatory. If you don't understand what exactly something is doing, though, feel free to ask.

If I wanted to use an image instead of a solid color, I would do this instead,

@media (min-width:768px) {
body {
background: url('PASTE IMAGE DIRECT URL HERE') center center fixed !important;
background-repeat: no-repeat;
background-size: 100%;
}
}

@media (max-width: 768px) {
body {
background: url('PASTE IMAGE DIRECT URL HERE') center center fixed !important;
background-repeat: no-repeat;
background-size: 100%;
width: auto !important;
min-width: 600px !important;
}
}


This code is something I've been experimenting with and may not work as expected all the time. Basically, what it should do is automatically resize the image to perfectly fit the viewer's screen regardless of what their screen size is. If you'd rather use what everyone knows works fairly well (though the resizing isn't perfect), you can use this instead,

body {
background: url('PASTE IMAGE DIRECT URL HERE') no-repeat center center fixed;
background-size: cover;
}


Now that that's done, I'm going to save my code as a .css file. Make sure you're saving it as a .css file. Accidentally saving it as the default .txt is a very common mistake and saving it as anything other than .css will cause it to not work in your den. Then, I'm going to upload it to Dropbox and link it to my den. Here is a guide to doing that using Dropbox, and here is a guide to using Google Drive for it. Some images are broken, however if you're using Dropbox and need help, let me know. I've used it for Lioden CSS for years.

I'll be saving my code several times throughout the coding process so I can see what I'm doing and how everything looks.

Now that it's linked to my den, I can see that the background code I used earlier doesn't change the background of the entire page. That is because there are two more backgrounds (to make things easier, we'll call these the foreground)on top of the body background. That's easy to change, though! I'd like my foreground to be a little bit lighter in color than the body background, and I'd like a border around it, so I'll do this,

.col-md-9.col-xs-12 {
background: #143C54 !important;
border: 4px double #91AFC2 !important;
border-top: none !important;
border-right: none !important;
border-bottom :none !important;
}

div.container.main {
background: #143C54 !important;
border: 4px double #91AFC2 !important;
border-left: none !important;
}


As you can see, borders for the foreground can be "fun" if you want them to go all the way around without anything strange happening to them. Now I'm going to save my file again, and since I'm using Dropbox, it's going to automatically update my den so I can see what I've just done without having to get a new link. I don't think Google Drive does that, but I may be wrong. It's been a while. Now I can see that the text on the foreground isn't really readable with this background, so I'll just change it by adding this to the body background,

color: #C3DAE8 !important

so now the body code looks like this,

body {
background: #113145 !important;
color: #C3DAE8 !important;
}


Be careful with this, though, because it changes the color of all the text on your page. You can later "overwrite" it so specific bits have different colors by just specifying a different color for it when you get to it, but it's not always great if you're starting completely from scratch and updating as you go.

Now I'll change the navigation bar, since it's connected to the foreground. I'll also make the text on it a different font, because why not?

.navbar {
background: #143C54 !important;
border: 1px solid #91AFC2 !important;
border-bottom: none !important;
border-top: none !important;
border-right: none !important;
box-shadow: none !important;
font-family: 'Century Gothic';
}

.navbar li a {
color: #FFFFFF !important;
}

.navbar li a:hover {
background: #0F2F42 !important;
}


.navbar controls the actual bar, .navbar li a controls the text on it, and .navbar li a:hover is what happens when someone hovers over one of the links.

Now, I'll do the top bar (the one at the very top of the screen), the "breadcrumb" (the thing that says Home / Profile on it), the event box (an example of this is the snuhlion thing during the December event. it isn't visible every month) and the sidebar.

.breadcrumb {
background: #0F2F42 !important;
color: #C3DAE8!important;
border: 1px solid #91AFC2 !important;
}

.feature {
background: #0F2F42 !important;
color: #C3DAE8!important;
border: 1px solid #91AFC2 !important;
}

.topbar {
background: #143C54 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
border-top: none !important;
border-bottom: 4px solid #91AFC2 !important;
}

.sidebar {
background: #091B26 !important;
color: #C3DAE8 !important;
border: none !important;
}

.panel {
background: none !important;
border: none !important;
box-shadow: none !important;
}

.chat_light {
background: #0F2F42 !important;
color: #C3DAE8!important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
}

.chat_dark {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
}


.breadcrumb controls the breadcrumb, .feature controls the event box, .topbar controls the bar at the very top, .sidebar controls part of the sidebar, .panel controls the "panels" on the sidebar with things like the game stats (I just remove the background, border, and box shadow on them so it's like they don't exist, I respect anyone who makes them look nice without doing that), .chat_light and .chat_dark control the chatbox.

Real quick I'm also gonna do the headers (-lion's name-'s den, achievements, etc.)

h1 {
text-align: center !important;
color: #C3DAE8 !important;
font-family: 'Century Gothic' !important;
}

h3 {
text-align: center !important;
color: #C3DAE8 !important;
font-family: 'Century Gothic' !important;
}


h1 is the main header with -lion's name-'s Den, h3 controls the headers on the sidebar. Keep in mind that if you use <*h1>text<*/h1> or <*h3>text<*/h3> in your den without the asterisks, it will also affect those.

And now the pride tables. Yay.

.top {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
font-family: 'Century Gothic' !important;
}

th {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
font-family: 'Century Gothic' !important;
}

.bottom {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
font-family: 'Century Gothic' !important;
}

.left {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
font-family: 'Century Gothic' !important;
}

td {
background: #091B26 !important;
color: #C3DAE8 !important;
border: none !important;
}

.right_cub {
background: #0F2F42 !important;
}


.top and th control the headers, .bottom controls the bottoms of tables that have them (for example, the mutation counter), .left controls miscellaneous bits that the other codes didn't get, td controls the insides of the tables, .right_cub controls how cubs are listed in your pride list.

Now that all the major things are done, it's time for links. This is very easy.

a:link {
color: #FFFFFF !important;
}

a:visited {
color: #FFFFFF !important;
}

a:hover {
color: #E0E0E0 !important;
}


a:link controls normal links, a:visited controls links you've already clicked on, a:hover is what happens when someone hovers over a link. If you want to add a transition effect where the color slowly changes to the hover color when hovered over, just add transition: 0.5s; to a:link. 0.5s is the time it takes to transition to the hover color and can be changed to be shorter or longer. Just change the number.

If you want links in different areas to be different from other links, you can do that by putting the selector (the part before the {, for example .topbar, .breadcrumb, .sidebar, etc.) in front of a:link, a:visited, and a:hover. Make sure to keep the normal a:link, a:visited, and a:hover, though. For example, I could do this if I wanted the top bar links to transition, but don't want any of the others to transition,

a:link {
color: #FFFFFF !important;
}

a:visited {
color: #FFFFFF !important;
}

a:hover {
color: #E0E0E0 !important;
}

.topbar a:link {
color: #FFFFFF !important;
transition: 0.5s !important;
}

.topbar a:visited {
color: #FFFFFF !important;
}

.topbar a:hover {
color: #E0E0E0 !important;
}


Congratulations, by this point, you've coded the majority of your den! There are just a few pieces left.

The first of those few pieces we'll do are the alerts (for example the notification telling you you have a new message), and the attack won/lost messages. Because I'm lazy and don't look at these much, I'm going to make them all the same.

.alert-danger {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
}

.alert-success {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
}

.attack-won {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
}

.attack-lost {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
}


I think these are pretty self-explanatory, so I won't explain them. Feel free to ask about them anyway though.

Now let's do the buttons and text input areas. These are pretty easy as well, though a bit tedious.

input[type="button"] {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="submit"] {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="text"] {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="password"] {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

textarea {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

select {
background: #0F2F42 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="button"]:hover {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="submit"]:hover {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="text"]:focus {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

input[type="password"]:focus {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

textarea:focus {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}

select:focus {
background: #091B26 !important;
color: #C3DAE8 !important;
border: 1px solid #91AFC2 !important;
text-align: center !important;
text-shadow: none !important;
box-shadow: none !important;
}


button and submit control buttons, textarea, text, and password control text areas, select controls drop down boxes. hover controls what happens when the thing is hovered over, and focus controls what happens when a thing is clicked on so something can be selected or typed into.

We're almost done! We just have the progress bars, now.

.progress {
background: #000000 !important;
border: 1px solid #051B29 !important;
}

.progress div {
color: #C3DAE8 !important;
}

.progress-bar-warning {
background: #2C6282 !important;
}

.progress-bar-danger {
background: #2C6282 !important;
}

.progress-bar-success {
background: #2C6282 !important;
}

.progress-bar {
background: #2C6282 !important;
}


.progress controls the unfilled part of the bars, .progress div is the text color, and everything else controls the filled part of the bars.

AND THAT'S IT. It's all been coded. My side has yet another CSS code. Oh god. Hopefully, if you've been following along making your own, you've also succeeded, and if so, congratulations! I'm proud of you. You should show me what you've done. I like looking. If not, show me your code and tell me what you're trying to do and I'll see if I can help. If your code isn't showing up at all, also show me the code you are using to link it to your den.

Want to see the code I made in action? It's over here on my side account. Probably. If it isn't various shades of dark blue with no images and white links, I've changed it at some point. Let me know if you want to see what it looks like. You CAN use it if you really want, but it was made with the intention of showing you how to make your own. Still, message me for the code if you want it.




Hrt Icon 5 players like this post! Like?

Chezzy-[G2 MR
Vitbomb Felis] (#10464)

Toxic
View Forum Posts


Posted on
2016-01-05 13:27:59
Someone actually messaged me with the right codes i needed for my posts to look pretty on the chatter thanks anyway going to try and make my own den now since i know how to use drop box would i add the expanding table into the note pad for it to work on my den? i am going to try n-n



Hrt Icon 0 players like this post! Like?

Chezzy-[G2 MR
Vitbomb Felis] (#10464)

Toxic
View Forum Posts


Posted on
2016-01-05 17:03:31
xD can you tell me what i did wrong? https://www.dropbox.com/s/xkt3ir3o6iloabc/purplecheshire.css i put everything together like you said and my dens still white



Hrt Icon 0 players like this post! Like?

✷ Tserin (#2230)

Prophet
View Forum Posts


Posted on
2016-01-06 02:54:39
Chezzy -- Did you link it properly to your den? Instructions for that should also be in the Dropbox guide I linked.

Also, HTML coding does not go into the CSS code. It will not work. You have to put HTML directly in your den description. Basically the reason for this is that HTML creates things while CSS gives them appearances, so if you put in CSS for something that doesn't actually exist on the page that the CSS code is on, nothing's gonna happen.



Hrt Icon 0 players like this post! Like?

Chezzy-[G2 MR
Vitbomb Felis] (#10464)

Toxic
View Forum Posts


Posted on
2016-01-06 08:30:25
I did use the same code everyone uses for their free dropbox css dens and it still did not work so it is linked correctly in my den xD and i was just testing the expanding box html in that coding as it dont work on every layout so there must be something added into the certain css files that allows those to work but that is all the extra bit i added to your stuff i did not even change hex code colors just added a back ground was i suppose to remove the @ and the importants?



Hrt Icon 0 players like this post! Like?

✷ Tserin (#2230)

Prophet
View Forum Posts


Posted on
2016-01-06 09:36:13
Chezzy -- No, you're supposed to keep those all in since they're part of the coding. I don't see anything wrong with the actual code. Do you have the public folder on Dropbox, and is it in there? And when you got the link to it, did you right-click it and select "copy public link"?



Hrt Icon 0 players like this post! Like?

Yrisa⛄{back 4sept} (#62329)

True King
View Forum Posts


Posted on
2016-06-02 04:01:33
I would like to thank you for this well explained post :)
With this post, Feather's post, and Kat's free CSS examples i checked to understand how it was build, i was able to do a CSS for my den, and .. to UNDERSTAND what i did and why !

At least for the vast majority ... because i still have some questions ...
For these 3 progress
.progress-bar-warning {
background: #2C6282 !important;
}

.progress-bar-danger {
background: #2C6282 !important;
}

.progress-bar-success {
background: #2C6282 !important;
}

i absolutely don't know what they do ... I let them like that, a blue background should be visible, but nothing is blue on my den ...



Hrt Icon 0 players like this post! Like?

shiver (#89797)

Heavenly
View Forum Posts


Posted on
2016-08-01 11:17:42
hello there !! 'v'7 would you mind helping me out a bit ?
im struggling to create my own custom css using this guide . i seem to be running into trouble when trying to save / move to dropbox as a css file , as when i paste the final result into my territory description , there is no result . would you perhaps be open to an organized time to screen-share , and walk me through what i am to do ?

thank you in advance !!



Hrt Icon 0 players like this post! Like?

Kat .:Red Lion of
Voltron:. (#94329)

Amiable
View Forum Posts


Posted on
2016-08-05 11:30:12
@♚ ELK ♚ You could always give Google Docs a try? It's a bit tedious when you want to sample a color since you have to upload the .css file again, but there aren't many problems which I come across. Plus, you can keep previous edits so if you messed up something, making the whole page become the default page again, you could go back to the last edit and upload that one. I can't say that it's easier than dropbox, but I haven't seen any problems with it other than organization which isn't that hard to fix. Google Docs does make you do more work though. You can decide. Just a suggestion since I just finished my first .css page today using Google Docs. ^~^ I hope your page turns out great!



@Yrisa⛄ I think those are suppose to be for the other people attacking you for the Territory and such. I don't really know though. Just a guess ^w^



Hrt Icon 0 players like this post! Like?


Edited on 05/08/16 @ 18:33:13 by Kat (#94329)

☆ Patha [3x Ros
Ice Dawn] (#80245)

King of the Jungle
View Forum Posts


Posted on
2016-08-28 15:08:19
YESSSSSSS THANK YOUUUUUU

*shoves thread into bookmark bin*



Hrt Icon 0 players like this post! Like?

AlienatedOddity (#97330)

Sinister
View Forum Posts


Posted on
2017-04-08 01:51:09
OMG, Thank you so much! I shall worship the ground you walk on until the end of your days. But srsly, you are amazing!!



Hrt Icon 0 players like this post! Like?

AlienatedOddity (#97330)

Sinister
View Forum Posts


Posted on
2017-04-08 01:57:24
How do we put our documents in a css file? The only two document types are txt and all files.



Hrt Icon 0 players like this post! Like?

Ebonixi (#95756)

Recognizable
View Forum Posts


Posted on
2017-06-28 18:53:00
@TwistedForgotten
Not sure if you got a reply elsewhere for this but you just add .css to the end of it (remove the .txt that was there originally) it should work then.



Hrt Icon 0 players like this post! Like?


Edited on 26/07/17 @ 18:08:35 by Zakiya (#95756)

koura. #brockhampton (#117887)

Fearsome
View Forum Posts


Posted on
2017-07-26 18:03:21
.



Hrt Icon 0 players like this post! Like?


Edited on 01/08/17 @ 10:24:18 by Koura ༄༅ (#117887)

Hibi (#116727)

Dreamboat of Ladies
View Forum Posts


Posted on
2017-08-01 04:55:19
Bookmarking <3
A very great thread <3



Hrt Icon 0 players like this post! Like?

LoonyMoon {[Main]} (#16117)

Bone Collector
View Forum Posts


Posted on
2017-08-13 14:10:16
kk so how do you make the foregrounds, as you call it, invisible? I would like to have it transparent with just a border around where the boxes are.



Hrt Icon 0 players like this post! Like?







Memory Used: 649.45 KB - Queries: 0 - Query Time: 0.00000 - Total Time: 0.00439s