Jump to content

Text - color


_tina_

Recommended Posts

Through external or even internal CSS files. For example:

<p style="color:white;">This is white text</p>
<p style="color:blue;">This is blue text</p>

If you want to reuse your styles, you can do this:

p#white { color:white}
p#blue{color:blue}

<p id="white">This is white</p>
<p id="blue">This is blue</p>

More help at: W3Schools CSS

Link to comment
https://forums.phpfreaks.com/topic/176298-text-color/#findComment-929186
Share on other sites

Thank you, but won't that put each one on a new line?  Thst i the problem I'm having.

 

Thanks again.

 

Through external or even internal CSS files. For example:

<p style="color:white;">This is white text</p>
<p style="color:blue;">This is blue text</p>

If you want to reuse your styles, you can do this:

p#white { color:white}
p#blue{color:blue}

<p id="white">This is white</p>
<p id="blue">This is blue</p>

More help at: W3Schools CSS

Link to comment
https://forums.phpfreaks.com/topic/176298-text-color/#findComment-929187
Share on other sites

Through external or even internal CSS files. For example:

<p style="color:white;">This is white text</p>
<p style="color:blue;">This is blue text</p>

If you want to reuse your styles, you can do this:

p#white { color:white}
p#blue{color:blue}

<p id="white">This is white</p>
<p id="blue">This is blue</p>

More help at: W3Schools CSS

That would modify the whole <p> tag.

 

You could use this instead...

<span style='color: #ffffff;'>White Text</span>

Link to comment
https://forums.phpfreaks.com/topic/176298-text-color/#findComment-929200
Share on other sites

have not checked it, but I think this is right ( the principle is )

 

p #white { color:white}
span p .blue{color:blue}

<p id="white">This is white<span class="blue">This is blue</span></p>

 

This is correct coding but can be simplified and use a class if reusing elsewhere on the same page

 

<p class="white">This is white<span>This is blue</span></p>

 

.white {color:white;}
.white span {color:blue;}

Link to comment
https://forums.phpfreaks.com/topic/176298-text-color/#findComment-929370
Share on other sites

have not checked it, but I think this is right ( the principle is )

 

p #white { color:white}
span p .blue{color:blue}

<p id="white">This is white<span class="blue">This is blue</span></p>

 

This is correct coding but can be simplified and use a class if reusing elsewhere on the same page

 

<p class="white">This is white<span>This is blue</span></p>

 

.white {color:white;}
.white span {color:blue;}

 

very true, but I did that just in case the op wanted to add more colours or styles within the text  ;)

Link to comment
https://forums.phpfreaks.com/topic/176298-text-color/#findComment-929403
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.