Signups are currently closed. Check back soon!

Studio X Help Guide

CSS Basics

Colours, fonts, spacing, layouts and animation.

CSS decides how things look. You write it inside a <style> block (put it at the top of Your Content). Each rule picks some elements with a selector, then lists properties and values in curly braces:

<style>
  p {                 /* selector: every <p> */
    color: purple;    /* property: value; */
    font-size: 15px;
  }
</style>

You can also style one element directly with a style attribute: <p style="color: purple">. That's handy for quick one-offs, but a <style> block keeps things tidy.

Selectors: picking what to style

SelectorPicks
pevery <p>
.fancyeverything with class="fancy"
#introthe one element with id="intro"
.card p<p>s inside something with class card
a:hoverlinks while the mouse is over them
h2, h3both <h2> and <h3>
Try it: edit the code and watch the resultAdd to my profile
Loading...

Colours

Colours can be names (tomato), hex codes (#0149cf), or rgb(). Add a fourth number to rgba() for see-through colours. Gradients blend between colours.

Try it: edit the code and watch the resultAdd to my profile
Loading...
Tip: Profile Colours in Studio X already set your page's main colours. You can use those same colours in your own CSS, so everything matches even when you switch presets. See Xinsto Hooks.

Text and fonts

Try it: edit the code and watch the resultAdd to my profile
Loading...

Want a special font? Many free font sites give you a <link> line to paste at the top of your content, then you use the font's name in font-family. Always list a backup font after it, like font-family: "Fancy Font", sans-serif;.

The box model: padding, border, margin

Every element is a box. Padding is space inside the border, border is the line around it, and margin is space outside. border-radius rounds the corners and box-shadow adds a shadow.

Try it: edit the code and watch the resultAdd to my profile
Loading...

Backgrounds

A background can be a colour, a gradient, or a picture. Pictures repeat (tile) by default, very 2006.

Try it: edit the code and watch the resultAdd to my profile
Loading...

Layout: side by side with flexbox

display: flex puts the boxes inside it in a row. gap spaces them out, and flex: 1 makes them share the width.

Try it: edit the code and watch the resultAdd to my profile
Loading...

To center something both ways inside a box, use display: flex; align-items: center; justify-content: center;.

Layout: grids

display: grid is perfect for photo galleries and Top 8s. repeat(auto-fill, minmax(100px, 1fr)) fits as many columns as there's room for, so it works on phones too.

Try it: edit the code and watch the resultAdd to my profile
Loading...

Looking good on phones

Lots of people will see your profile on a phone. A @media rule only applies when the screen is narrow, so you can stack things up:

Try it: edit the code and watch the resultAdd to my profile
Loading...
Phone-friendly habits: avoid fixed widths wider than about 320px (use max-width or % instead), and give pictures max-width: 100%.

Hover effects and transitions

Try it: edit the code and watch the resultAdd to my profile
Loading...

Animations

@keyframes describes an animation; animation plays it.

Try it: edit the code and watch the resultAdd to my profile
Loading...

Comments in CSS

Notes in CSS go between /* and */. They're great for remembering what each part does.

Next up

Now that you can style anything, learn how to restyle the parts Xinsto adds: Xinsto Hooks »