Rich text – Web design tutorial

By | February 21, 2020


Rich Text is a one-stop shop for a ton of
content: headings, paragraphs, links, lists, blockquotes, images, or videos. Often, we want super precise control over
each and every element and class. But Rich Text Elements (or RTEs as they’re
affectionately abbreviated) can chunk a lot of this into just one place. This is huge for convenience.
Why? Well it keeps everything together which is
great for long-form content, but it’s also great for collaborators (like customers, clients…). They can easily go in and create or modify
rich content from the Editor. Let’s cover three different pieces to Rich
Text Elements: adding content, styling content (the basic route), and Styling content (the
super custom route). Because these two don’t work without content,
let’s start there. Here’s a blog post. We know that because right at the top, it
says “Blog Post.” Over in the Elements panel, we can drag a
Rich Text Element right into our project. Just like other text elements, we can double
click to mess with the contents. At any time, we can hit Enter to reveal a
plus icon. Let’s press it. And from here, we can add other media like
images or videos. Let’s start typing a new line of text. Let’s make this a heading. And we can select any text element inside
our Rich Text Element — and designate it a heading or a block quote, or anything else. Like we said, let’s make this one a heading. That’s adding content. Let’s style the content. Styling Rich Text Elements (abbreviated RTE)
can be a bit different from styling other, individual elements. This is because we have no idea what a collaborator
might put in this field. And that’s okay. There’s a solution for this. We can select any of our elements inside the
Rich Text Elements, and go right on over to the element’s tag. Once that’s selected, we can make any number
of style changes, and it’ll affect the tags throughout the project (inside or outside
of a Rich Text Element). So if we go somewhere else in the project? Somewhere far away? And we drag in a Rich Text Element? And that Element has the same kind of element
we just styled the tag for? It’s already there. In fact, we can drag in a standalone element. A non-rich-text element. And it’ll have the same defaults for that
tag we just styled. That’s the basic route for styling content. Let’s move on and make this interesting. What if we want to adjust styling, on an element
type, like paragraphs? But only for rich text elements we specify, instead of affecting every paragraph in our project? This is it. Once we add a class to a rich text element,
we can select any of the paragraphs (this works for any type of element inside a rich
text element), and select the tag. Now, if we make changes here, it’ll be just
like a few moments ago in that they will affect paragraphs everywhere. But let’s press nest selector inside of
rich text class, that’s the class we just created. Now, any changes we make to the paragraph
style, as we go in and make these changes, they’ll only affect paragraphs inside rich
text elements with our new rich text class applied. Let’s test that out. We’ll go elsewhere, and we’ll drag onto the
Canvas a rich text element. This is still using the default paragraph
styling for our project. But if we select the rich text element? And we go in and add our class? We can see that doing that now implements
the All Paragraphs tag we styled — that tag is nested inside our Rich Text Class. Let’s summarize this, and to save time, we’ll
use the abbreviation RTE. At any time, we can drag an RTE into our project. As we already know tags can be styled for
many element types throughout a project, whether or not they’re in an RTE. But if we add a class to an RTE, and we go
to style tags for any of the elements inside? We have the option of going in and styling
that tag independently — so it only affects those element types when they’re nested inside
an RTE that has the class we just created. So, Rich Text Elements. Super powerful for long-form content. Sometimes we abbreviate using RTE.

3 thoughts on “Rich text – Web design tutorial

  1. Kopstorm Post author

    Hi there,

    how do i apply these styles to a Rich text field in the CMS?
    I have trouble styling the richt text fields thats connected to the CMS.

    Thanks

    Reply
  2. Paul Ignacio Post author

    "And to save time, let's use the abbreviation RTE, which stands for Rich Text Element." HAHAHA

    Reply
  3. Brent Lagerman Post author

    when adding images in the CMS you can left, right, center align them. How do you apply styles to a specific state, like for instance a common thing to do is add margin right to the left floated images but you wouldn't want that on all of them…

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *