Skip to main content
Participating Frequently
May 30, 2017 4:05 PM UTC
Answered

Change word color in middle of sentence?

Working in Dreamweaver CC2017 with Windows 10. I have a line of type that is .5mm, 1.0 mm, 1.5 mm. I would like each one of these sizes to be in a different color. These sizes are in a block of specifications that are in a <p class>. From what I can find, it seems that this might be a job for a <span class> but I can't seem to make it work. Do I need to close the <p> before targeting the <span> or what? This is all within a <div>. I have created a selector (.redspec) that has all of the same text attributes as the <p class> but with the red color designation.

Also...I have a block of type that is three words each with three lines. Can I get them to align like a tabbed chart?

Thanks for any help,

This topic is closed to new replies. Start a new post to keep the conversation going.
Jon Fritz
Jon FritzCorrect answer
Community Expert
May 30, 2017 4:14 PM UTC

Span tags should work fine for this.

What are your class names and are you using them correctly within the <span> tags?

Here's a simple example of the css...

.red {

     color:red;

}

...and the html could look like...

<p>Some default text here<span class="red">Red text here</span>and default text here</p>

Keep in mind, class names in css can't start with numbers, so you'll need to use something like .five_mm instead of .5mm.

5 replies

BenPleysier
Community Expert
Community Expert
May 30, 2017 4:14 PM UTC

<p>This is my <span class="redspec">sentence</span> that I want to change midstream</p>

Translate
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Participating Frequently
May 30, 2017 4:29 PM UTC

Ben,

Perfect!!! Thanks so much. Any thoughts on the tabbed block of type?

Jim

Translate
Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
May 30, 2017 4:14 PM UTC

Span tags should work fine for this.

What are your class names and are you using them correctly within the <span> tags?

Here's a simple example of the css...

.red {

     color:red;

}

...and the html could look like...

<p>Some default text here<span class="red">Red text here</span>and default text here</p>

Keep in mind, class names in css can't start with numbers, so you'll need to use something like .five_mm instead of .5mm.

Translate
Participating Frequently
May 30, 2017 4:30 PM UTC

Thanks, Jon....

Correct!!

Any thoughts on the tabbed copy block?

Jim

Translate
Jon Fritz
Community Expert
Community Expert
May 30, 2017 4:36 PM UTC

If you have tabular data, use a table...

<table>

     <tr>

          <td>One</td>

          <td>Two</td>

          <td>Three</td>

     </tr>

     <tr>

          <td>One a</td>

          <td>Two a</td>

          <td>Three a</td>

</tr>

     <tr>

          <td>One b</td>

          <td>Two b</td>

          <td>Three b</td>

     </tr>

</table>

Translate