• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

CSS Help & Resources

Circuit

[cd=font-weight: bold; font-style: italic; backgro
4,815
Posts
16
Years
  • We Roleplayers gather here today to strive towards better CSS for writing purposes such as clarity and design. Here are some guidelines which aim to help you design your CSS so that it appears cleaner and gives an overall better impression for your roleplay! Let's begin! NB: This will not give you any design templates, since those can already be found for RPs in the RPT.

    Design
    Arguably the most important factor in any CSS construction, the design is what readers will first see when they come to read your RP, be it the OP or a character post. This can immediately deter or attract potential RPers and readers, and is very important that you make it as attractive as possible, whilst maintaining readability and simplicity. Here are a few tricks to ensure that you get the most out of your CSS design:
    • Main Body Borders
      These borders can make or break CSS and you really should aim to make them appear as smooth and reduce the bulkiness that some borders end up having. Block colour, square borders are very clunky, and very often detract from a potentially very nice CSS design. This can be prevented by using border rounding, using the following code:

      The order of the value for each corner is as such: top-left, top-right, bottom-right, bottom-left. Example:
      Spoiler:

      Redacting one value results in the bottom-left and top-right values being the same. Redacting two values results in the top-left and bottom-right values and the bottom-left and top-right values being the same, and redacting three values results in all radii being the same. Example:
      Spoiler:

      And with that, you can now take the edge off your otherwise clunky and sharp borders, which mainly become an eyesore in bulk colour.

      Another technique you can use to improve your borders is to stylise them. This can be done using the main border command, which often appears as such:

      Here you can change the "solid" definition to one of the following:
      "groove" "ridge" "inset" "outset" (omitting the "" of course). This results in the following examples:
      Spoiler:

      As you can see, these make for more refined borders. Couple these with border rounding, and you can make some really nice borders, which are pleasing to the eye. There are plenty of other ways to achieve some totally wicked or simplistic designs, if you just mix codes creatively.

      Also, try and keep away from using extremely bright and/or vivid colours as border colours. These (at least imo) look tacky and are quite distracting. I prefer dull colours, which can be brighter if you use inset, outset, groove or ridge borders.

      [*]Main Body Backgrounds
      Very often I come across CSS with very abstract, busy and loud backgrounds in RPers' CSS, and it really detracts from the text, in some cases making it unreadable. This doesn't mean that the text isn't visible or is the wrong colour against the background, but that the background image used simply attracts the reader's attention too much that focusing on the text is very difficult. To avoid this, backgrounds with vibrant colours should be avoided, when placed directly below the text you want the reader to see. Here is an extreme example indicating this:
      Spoiler:

      Okay, so that was probably more extreme than you'll likely ever see in RPT, however I've seen similar very occasionally, and CSS designs that achieve a similar effect just not as extremely are more common. The first thing to do is plop a nice child body in there, for your text to sit on so it can be read without the background detracting your attention from it. Example time:
      Spoiler:
      As you can see this is a LOT easier on the eyes. I apologise to those who I've turned blind from my first example. You can also lower the opacity on the child body if you reeeaaally want your background to show through, and this can be done in the "background-color" code of the child body. Instead of using a hexadecimal code for your colour (#------) you can use the "rgba" format. This uses the rgb values and adds and "alpha" value which controls the opacity. 1 is fully opaque and 0 is fully transparent. It looks like this:

      This means the background is white with an opacity of 80% (Is 80% opaque). Applied to my previous example it looks like this:
      Spoiler:
      So you still get your background in place, but can still read the text. Best of both worlds eh? Hahahaha!

      [*]Child Body Backgrounds
      Okay, so I pretty much covered this before, and it is pretty obvious how it should look in order to preserve text legibility, but just to reinforce the point; do not have vibrant colours as your child body's background. Keep them dull, close to white (or black) or so that the text is still very visible and you do not strain your eyes to read it. Slight gradients work wonders in keeping a child body's background interesting whilst not detracting from the text. That's all for that really, it is pretty self-explanatory once you've seen the previous examples.


    Finally, make sure your design FITS YOUR CHARACTER. If you have a lively bright background for a very dark and serious character, well, no one is going to take your character seriously. You must ALWAYS ensure that your design fits your character's personality, and ensure that the response from the CSS matches the response from your character overall. CSS design can change the mood of your character with as simple a change as background colour. Be aware of this, and ensure that the emotions conveyed from the CSS are the right ones.

    Text
    Whilst it may not seem like it, text appearance is a very big factor in attracting or deterring readers, and you should always strive to find the best text in any design. On average, I spend around half of my time on the text when I design CSS for a character (if I do design CSS). There's a lot to consider when designing your text, so think carefully about what you choose since it has a fairly large impact for something so minimal. Here is what you should try and think about each time:
    • Text Font
      An obvious one, but it is also a very important one. First things first: DO NOT WRITE IN COMIC SANS. If you do, stop it. On that same note, do not write in ANY cursive font, as they are not suitable for large blocks of text and look horrible. There are plenty of sans-serif and serif fonts which will give the same feeling across, in a style that is a lot easier to read. For a good list of fonts of each style, look here.
      Text font should always match your character; generally, more upbeat characters benefit from sans-serif fonts whilst darker and more serious characters benefit from serif fonts. Of course, it's up to you to decide how you want your text to appear and convey to your reader the feelings and emotions you want.

      [*]Text Colour
      Colour matters. It needs to be legible for a start, but also can be used to convey a little bit of emotion. Red for passion and danger, blue for colder characters, green for passive, more upbeat characters and so on. Ultimately, I don't advise colouring your text anything other than greyscale, but some people do, and want to, so here is the advise. Be aware on what colours drag out which emotions, and use them accordingly. Making text look pretty isn't paramount to legibility and emotional response.

      [*]Text Size
      Last thing here, your font size matters too, and does add to the emotional response of the reader. Smaller fonts indicate a more timid character, whilst larger fonts give a feeling of presence and make your character feel larger and bolder as a result. Don't be ridiculous with sizes, since this only works up to a point, before just being plain silly. I mean come on, you're gonna have your posts deleted if your font is 48px large or is so small it can't be read.


    Last words: Ultimately, it is your writing which will invoke the most emotional response from your reader, but you want to reinforce the feelings you are aiming to convey through your stylisation. But if you write well enough, any design that doesn't perfectly fit wont have much negative impact. That said a good design will impress, and you'll garner a lot more respect and credit for a very well designed bit of CSS to compliment your character. At the end of the day though it is your writing that matters, and if you make people focus on that, with or without CSS, and focussing on that will get you very far indeed!

    Hope this helps some of you :)
     

    Sopheria

    響け〜 響け!
    4,904
    Posts
    10
    Years
  • How do I get a scroll box for thing like trade shops?

    You have to put your text inside a [cd], and give it overflow-y: auto, and set the height that you want the scroll window to be. So for example:

    Spoiler:


    Obviously though you'll want to replace the lorem ipsum with your trade shop content, but you get the idea :P

    And the result is this:


    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet diam at nisi blandit, et aliquam tellus vestibulum. Maecenas ut urna non nibh elementum finibus. Nullam nisl dui, tempor at posuere ac, bibendum at risus. Nulla facilisi. Suspendisse libero quam, imperdiet et congue nec, maximus pellentesque magna. Vestibulum fringilla posuere mattis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean at odio iaculis, venenatis metus non, fermentum purus. In venenatis ipsum vel ante facilisis facilisis. Integer aliquet eros nec pellentesque porta. Pellentesque elementum dapibus lorem ac posuere. Nam neque tellus, aliquam eget ullamcorper vitae, laoreet eget sapien. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ac risus sed ligula aliquet tempus in vulputate purus. Nam eget faucibus augue.

    Cras dui nisl, laoreet quis lacus vel, condimentum posuere purus. Nam rhoncus vehicula ex, a bibendum risus feugiat dictum. Quisque id vehicula lorem, a lobortis metus. Curabitur maximus quam in lorem elementum, nec fermentum nulla lacinia. Aenean id eros eget dolor ullamcorper gravida a quis justo. In varius turpis vestibulum suscipit hendrerit. Aenean lacinia volutpat neque quis scelerisque. Maecenas dictum tellus ac ante scelerisque sollicitudin. Morbi vel ligula leo. Etiam accumsan non ipsum eget venenatis. Aliquam pharetra auctor ipsum sit amet tempor. Integer rutrum id arcu vitae condimentum. Aenean sagittis convallis urna, ut tristique turpis luctus nec. Sed id orci risus. Aenean consequat, sapien eu ultrices eleifend, odio velit maximus mi, rhoncus luctus ante arcu nec erat.


    Why is the background not showing?

    Do you mean in your signature? Or is there a certain post that your background isn't showing in?
     
    Last edited:

    Sopheria

    響け〜 響け!
    4,904
    Posts
    10
    Years
  • In my signature. Thanks in advance.

    Try this:

    Spoiler:

    I think it was because of the quotation marks around the attributes.


    468.gif
    As everyone knows, it visits peaceful regions, bringing them gifts of kindness and sweet blessings.

    VM PM

     

    Twilight Storm

    just your average weirdo ;D
    193
    Posts
    8
    Years
  • Try this:

    Spoiler:

    I think it was because of the quotation marks around the attributes.


    468.gif
    As everyone knows, it visits peaceful regions, bringing them gifts of kindness and sweet blessings.

    VM PM


    It's still not working.
     

    Sopheria

    響け〜 響け!
    4,904
    Posts
    10
    Years
  • Twilight Storm

    just your average weirdo ;D
    193
    Posts
    8
    Years
  • 1,682
    Posts
    8
    Years
    • Seen yesterday
    You can use border-image on PC.
    Placeholder


    -webkit- and -o- are just for backwards compatibility.

    HTML:
    [cd="border: 10px solid transparent; padding: 10px; -webkit-border-image: url('http://i.imgur.com/9LbRgtc.png') 8 stretch; -o-border-image: url('http://i.imgur.com/9LbRgtc.png') 8 stretch; border-image: url('http://i.imgur.com/9LbRgtc.png') 8 stretch; background-color: #FFFDFE; width: 120px"]Placeholder[/cd]
     

    Sopheria

    響け〜 響け!
    4,904
    Posts
    10
    Years
  • Is there some way to use CSS to play a GIF once when moused over?

    Not with the css we're limited to in posts. A gif doesn't have pause or play controls, unless you have browser plugins that make it possible. The closest you could come to doing it via css would be to hack it in with a :hover selector, which we unfortunately don't have access to in forum css :/

    Is there anyway to css an image map? I really want all the idvidiual parts of my signature to be links

    You could crop your signature image into several individual images. That way you'd be able to apply a link to each image :)
     
    1,682
    Posts
    8
    Years
    • Seen yesterday
    Continuing on my quest to find properties that work on PC, check out this!
    The transform property works!


    Texts


    HTML:
    [cd=" width: 200px; height: 100px; background-color: yellow; -ms-transform: rotate(7deg); -webkit-transform: rotate(7deg); transform: rotate(7deg);"] Texts[/cd]
    I know for a fact that rotate(angle) and scale(x,y) work.
     

    Lucario

    Hardly active since 2017!
    809
    Posts
    8
    Years
  • Quick tip for a scrolling background image: just put
    Code:
    background-attachment:fixed;background-repeat:no-repeat
    in with your background image code.
     

    Syvelocin

    Eevee Breeder
    182
    Posts
    13
    Years
  • I'm having a really hard time here lol. I can't get this to center. I would like to have it in the middle of the screen.

    Rules and Information
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
     

    Giggleswee

    [Screaming in emoji]
    142
    Posts
    7
    Years
  • I'm having a really hard time here lol. I can't get this to center. I would like to have it in the middle of the screen.

    Rules and Information
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text
    text text

    One thing, position: center isn't a thing. It's either position: absolute, position: fixed, position: relative or position: static. ( http://www.w3schools.com/cssref/pr_class_position.asp )

    If you want to center the whole thing you need to add in the first box
    Code:
    margin:0 auto;
    This (almost) always centers things (at least on this forum where some themes break css >.<)

    Protip: This only works when the div has a initial size set
     

    Syvelocin

    Eevee Breeder
    182
    Posts
    13
    Years
  • Ah thanks, perfect. I haven't used any tutorials but I was looking at a few examples of some code to figure out how to do similar things and it used position: center without margin: 0 auto and the post was centered. I wonder why that code was there then.
     

    Road

    beyond salvation
    767
    Posts
    15
    Years
  • Hello everyone! I was wondering if someone could help me figure out this one code.

    So far I've got the gist of using CSS, but the one thing I can't figure out is how to make two boxes float next to each other like in this example trade thread CSS (the "Wants" and "Trophy Case" boxes). I thought it was the float code, but when I used it my two boxes went all the way to the edge like this. Is there some sort of limit I have to set so it stays in line with the other boxes?

    Maybe a dumb question but I can't seem to figure out where I'm messing up. Thanks in advance! @w@
     

    Venia Silente

    Inspectious. Good for napping.
    1,232
    Posts
    15
    Years
  • For floating two boxes next to each other, you need to give them and the boxes right below extra information, so you'll find yourself using css-div.

    Quote this post and check the CSS code to see the example I give here. These are, more or less, the keys to aligning floating boxes properly:

    * Float all boxes, or float none.
    * To align N boxes, float (N-1) of them left and the last of them right, or the first of them left and the other (N-1) of them right.
    * After the floating boxes, add an empty box with the css-div content: [div="float: clear; clear:both;"][/div]. This disables the floating of elements (so that the following boxes don't get mixed into all of this)
    * In what regards to PokéCommunity CSS code: the css-divs contaning each floated box need to be contiguous, in that you don't break a line when finishing one to start the next. if you add a line break, the line break will also count in the floating elements.

    Example follows:


    Box One, not floated, main content. Here I talk about life, love, pizza and CSS.

    Floated box numero uno, this one floats to the left and should stick by the other's side. Give this box a width (width or max-width property) so that the browser knows how to align the content.
    Floated box numero dos, this one floats to the right and should stick by the other's side. This box need to have a width set so that added with the other one they don't go above 100%. In this example, both boxes have a max-width of 49%.
    (This small box doesn't need to hold any actual content inside, it's there only for the next content to align correctly to the two boxes; all that matters is that you use the "float:clear; clear:both" CSS tags.)

    Box Two, not floated, main content. Here I mostly part goodbye with the post and stuff.




    This is what happens if you add linebreaks between the css-div tags:


    Box One, not floated, main content, pretty much the same treatment as in the above example.

    Floated box to the left, with content and stuff.

    Floated box to the right, with content and stuff.

    (Clearing box)

    Box Two, not floated, main content. Same treatment as in the above example.

     
    Back
    Top