Skip to main content
Participating Frequently
May 30, 2017
Answered

Change word color in middle of sentence?

  • May 30, 2017
  • 2 replies
  • 1915 views

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 has been closed for replies.
Correct answer Jon Fritz

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.

2 replies

BenPleysier
Community Expert
Community Expert
May 30, 2017

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

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

Ben,

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

Jim

Jon Fritz
Community Expert
Jon FritzCommunity ExpertCorrect answer
Community Expert
May 30, 2017

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.

Participating Frequently
May 30, 2017

Thanks, Jon....

Correct!!

Any thoughts on the tabbed copy block?

Jim

Jon Fritz
Community Expert
Community Expert
May 30, 2017

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>