• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change the color of single word of selected text with keyboard shortcuts?

Participant ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

Is there a way to change the color of single word of selected text with keyboard shortcuts?

Thanks.

TOPICS
Code , How to , Interface , Performance , Product issue

Views

357

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 30, 2020 Dec 30, 2020

Not really, no. 

Text color is controlled by CSS. You would need to wrap your text in a set of <span> tags that also have a class added to them. That class would then have a selector in your .css file with the color property and whatever value you'd like to set.

You could create a wrapping Snippet of a set of span tags with a class, then highlight the text you want to change to a given color and double click the Snippet in the Snippets window to add it to the text...

1. Open your Snippets Window un

...

Votes

Translate

Translate
Community Expert ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

Not really, no. 

Text color is controlled by CSS. You would need to wrap your text in a set of <span> tags that also have a class added to them. That class would then have a selector in your .css file with the color property and whatever value you'd like to set.

You could create a wrapping Snippet of a set of span tags with a class, then highlight the text you want to change to a given color and double click the Snippet in the Snippets window to add it to the text...

1. Open your Snippets Window under Window > Snippets (or hit Shift + F9)
2. Click the New Snippet button (document with + icon) in the bottom of the Snippets window
3. In the dialogue that appears, give the Snippet a name, like Red Text
4. Ensure "Wrap Selection" is active
5. For "Insert Before" add something like... <span class="redtext">
6. For "Insert After" add in... <span>
7. Click OK
8. Between the page's <style> tags or in your .css file, add the selector...
  .redtext{color:red;}

From there on out, while working on that page or site, you can highlight text in Design View and doubleclick the Red Text snippet to wrap the selection in the span tags and turn it red.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

Thenk you Jon!

I Marked the answear like correct because it is.
But that means that the developer of dreamweaver doesn't implement an useful short cut!
This make a pair with another my perplexity: for different years a very boring bug ("shift + i" work like copy ) that is sill not solved!!!

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

I've insert what you said and now in the style tags I've this:
.redtext{
color: #FF0000;
}
But how can I use it?
Thanks again!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

I mean that I understand that is sufficient to create the snippet and I kow how to use it, I don't understand the function of the "<style> section"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

A <style> section within the <head> of your page is where you would keep page-specific css.

<style>
   .redtext {
      color:red;
    }
</style>

The above would allow you to use the snippet I gave earlier as many times as you likewithin that one page. Every time class="redtext" would be called inside an element of your page, the text would be red.

Personally, I would keep something like this in an external .css file. That way, there's no need to clutter up the <head> section of a bunch of pages with repetitive css properties. The css would be written one time in the external file and called on any page that references the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 30, 2020 Dec 30, 2020

Copy link to clipboard

Copied

LATEST

"I don't understand the function of the "<style> section"

Hi @gian carlog61267382,

Learn code.  It's the single most important investment you can make. Read chapters, work with code samples, take quizzes at the end.

- https://www.w3schools.com/html/
- https://www.w3schools.com/css/
- https://www.w3schools.com/js/

Reset keyboard shortcuts to default settings.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines