The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to change color of hex code only
gijeet
post Nov 23 2021, 09:40 AM
Post #1





Group: Members
Posts: 2
Joined: 23-November 21
Member No.: 28,177



Is there a way to change just the color of the hex code in this html snippet?
It does not seem to work for me.
The hex code makes a checkmark and I only want the mark red not the text
the <font> markup also does work and is not supported in html 5

the hex code is & #10004; I put a space btwn & and # so it does not get interpreted.

<p style="color:red;">✔</p> Same Day Shipping<br>

Thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 23 2021, 04:12 PM
Post #2


.
********

Group: WDG Moderators
Posts: 8,934
Joined: 10-August 06
Member No.: 7



QUOTE(gijeet @ Nov 23 2021, 03:40 PM) *

Is there a way to change just the color of the hex code in this html snippet?

Unsure nitpick: I think that's called an HTML decimal entity, compare https://unicodemap.org/details/0x2714/index.html unsure.gif

QUOTE
the <font> markup also does work and is not supported in html 5

You could use say a SPAN element instead:

CODE
<p><span>✔</span>Same Day Shipping</p>

Another idea might be to use CSS generated content:

CODE
p:before {
content: "\2714";
color: red;
}

Note how a completely different numerical code is used for the same character in CSS, no idea why.

Also I'm not sure how well supported this character is, to support older browsers you might use an image instead.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 23 2021, 04:56 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 19,945
Joined: 9-August 06
Member No.: 6



While SPAN would be more suitable, it shouldn't make a difference when it comes to if the color is displayed or not. I see no reason whey the posted example wouldn't work.

Or do you (the OP) by 'not work' mean that you don't want the line to break? Because red the check mark should be with the HTML/CSS you have. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
gijeet
post Nov 23 2021, 05:03 PM
Post #4





Group: Members
Posts: 2
Joined: 23-November 21
Member No.: 28,177



Sorry, I forgot to mention the code is inside a page builder. And I did change <P> to <span> which kept the checkmark on the same line as the text. Also, I used "&# 10003;" and now the checkmark is red. Not sure why the other code did not work but hey...it's working now.

Thanks for all replies!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Nov 23 2021, 05:17 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 19,945
Joined: 9-August 06
Member No.: 6



Well, what you posted works just fine. So either you don't have it exactly like that in the real document, or something else is affecting it. Hard to imagine what that could be though.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Nov 25 2021, 12:27 AM
Post #6


Jocular coder
********

Group: Members
Posts: 2,418
Joined: 31-August 06
Member No.: 43



QUOTE(Christian J @ Nov 24 2021, 06:12 AM) *

QUOTE(gijeet @ Nov 23 2021, 03:40 PM) *

Is there a way to change just the color of the hex code in this html snippet?

Unsure nitpick: I think that's called an HTML decimal entity, compare https://unicodemap.org/details/0x2714/index.html unsure.gif


Hmm, it's called "decimal" because it is a decimal number...

QUOTE

Note how a completely different numerical code is used for the same character in CSS, no idea why.


It's the same code: 10004 in decimal is 2714 in hex. I think you can write the HTML numeric wossnamethingy as & #x2714. (Note that "wossnamethingy" has the same semantic content as "entity", but it's longer.)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Nov 25 2021, 05:49 PM
Post #7


.
********

Group: WDG Moderators
Posts: 8,934
Joined: 10-August 06
Member No.: 7



QUOTE(Brian Chandler @ Nov 25 2021, 06:27 AM) *

It's the same code: 10004 in decimal is 2714 in hex.

Oh, at least some logic in the madness. But what is that UCS-2 Decimal: 5159 then?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Nov 26 2021, 01:55 AM
Post #8


Jocular coder
********

Group: Members
Posts: 2,418
Joined: 31-August 06
Member No.: 43



QUOTE(Christian J @ Nov 26 2021, 07:49 AM) *

QUOTE(Brian Chandler @ Nov 25 2021, 06:27 AM) *

It's the same code: 10004 in decimal is 2714 in hex.

Oh, at least some logic in the madness. But what is that UCS-2 Decimal: 5159 then?


I don't know what UCS-2 is. Perhaps it is just another way of encoding Unicode, like UTF-8, which makes high-value Unicode "ASCII-transparent". This is all a bit convoluted; Unicode itself is deliberately a mess, because its job is to enable round-trip conversion from every one of the relevant national character sets. So any craziness in (for example) Korean coding (three different codes for the same character depending on how it might be pronounced) has to be replicated in Unicode.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th November 2021 - 01:06 AM