When beginning with CSS, it can be easy to unnecessarily extend the length of your code. This usually isn't a problem, but if you're using a format that still uses the [style] BBCode (such as blogs or subpages) and hit the DSi/o3DS 2000 character text limit or you just want to clean it up, here are some things that you can do.
• Remove spaces Spaces are often (but not always) unnecessary in CSS, they can be removed in most cases, the same goes with line breaks.
• Putting code affecting the same element(s) together If you're doing this, you can merge the two pieces of code using a semicolon. Similarly, you can use commas to affect multiple elements. Here's an example:
body{color:lime}td{background:blue} would become
td,body{color:lime;background:blue}
(Note that an extra semicolon is not required after !important;)
Be careful of unnecessarily combining CSS, though, as it may lead to weird consequences.
• Remove unnecessary !importants Although !important is often needed for something to work properly (hence why it's often included in the other pages), this isn't always the case. Experiment with it and see if anything significant changes.
• Use shorter color values When setting a color, you may be able to save a few characters by using hex colors instead (or vice versa in some cases). For example, #FFF is shorter than white and red is shorter than #F00.
• Use shorter URLs Most sites that you may get images from, especially Discord, use very long URLs. In my experience, the best site to host images on is Imgur. No account is required to upload, the URLs are short, and the uploaded images appear on DSi/3DS.
GuiedGui's sidenote:
The process of reducing the number of characters used in CSS is called "minifying." In general, it is used to compress well-formatted, easily readable CSS into as few characters as possible so the CSS loads quicker. I generally do it to all the CSS I write on this website so the DSi can load it in as quickly as possible and also to save memory since it's not uncommon for it to run out of memory while loading a user profile or something of the like.