Skip to main content
Gareth_Williams
Inspiring
April 11, 2024
Answered

How To Make A New Text Style (Class)

  • April 11, 2024
  • 3 replies
  • 1085 views

Hi everybody, I’ve Googled it and tried to find videos on YouTube but I can’t figure it out! When you write some text in a webpage, if you select it you can change the properties in the properties panel with the CSS tab, such as font style, size and colour. However, how do you make those settings into a class so you can select it in the “class” dropdown menu in the HTML panel? I absolutely can not believe I can’t find this out on Google ot YT but I can’t! Sorry about that!

 

Thanks for your help,
Gareth

This topic has been closed for replies.
Correct answer Jon Fritz

Ok, thanks guys. I haven’t watched those videos because the written direction pretty much worked. I have marked the videos as correct. I’ll watch them when I get time. Hopefully tonight.

 

The only problem with the written directions is, after hitting enter when you name the class, the options to set the properties do not appear. Though they did the first time I did it! If you click on the properties section of the CSS Designer and then click on the “T” text icon you get some property options but in a different format to before! Anyway, this does work do I’m Ok now. Thanks again for your help.


I'm guessing here, but be sure to uncheck the "Show Set" checkbox on the right side in the Properties section of the CSS Designer.

If that box is checked, and you have few or no properties set, it will appear very limited or blank. 

3 replies

Nancy OShea
Community Expert
April 12, 2024

A re-usable class is prefixed by a dot.  Open your stylesheet CSS file in CODE View panel.

Use Dreameaver's code hints & auto code-completion features.  They're much faster and more precise than CSS panels.

 

.classname {

   property: value;

   property: value;

}

Ctrl / Cmd + S to SAVE stylesheet.  One your stylesheet is saved, you should see the classname in your Properties panel.

 

HTML:

<p class="clasname">This is a paragraph.</p>

 

Hope that helps.

 

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
April 11, 2024

I'm not sure what you're searching for, but there are tons of resources online for this (as illustrated by Lena).

The quick and dirty step-by-step is...

1. Open your CSS Designer (Shift + F11 if it's closed)
2. Click the + in the Sources section of the CSS Designer
3. Choose your Source, typically either an "attach existing" for an external sheet,  or "define in page" which adding a set of <style> tags
4. Click the + in the Selectors section of the CSS Designer
5. Add a class name over whatever DW auto-fills. Make sure to include the . in front (example: .red-text) and hit Enter
6. Next, in the Properties section of the CSS Designer (not in the main Properties Window yet), choose all the settings you want
7. Finally, select the text you want to affect in Design View, and choose the new class from the Class dropdown menu under the CSS tab in the main Properties window

Gareth_Williams
Inspiring
April 11, 2024

Ok, thanks both. I'll have a look at this after work tomorrow. Hopefully it will be Ok. I'll update the thread and let you know. 🙂

Community Expert
April 11, 2024