im a new member of this site

i hope you can help me, :)

i just want to know how to code in applying text color in html

for instance if i leave a comment in my friendster site. :icon_question:

i'm willing to wait for your response. ;)

thank you so much.

god speed.

Dani AI

Generated

Quick summary: text color in HTML is set with CSS. Inline styles are the fastest for a one-off (as demonstrated), but for maintainability use CSS classes or an external stylesheet and avoid the deprecated font tag. If leaving comments on a social site, note that many sites sanitize HTML/CSS and will ignore style attributes — check the site's help or try a small test.

Example (use a stylesheet or a <link> to one):

/* styles.css */
.highlight { color: #0077cc; }
.subtle    { color: rgba(0,0,0,0.55); }

/* HTML */
<p class="highlight">Colored paragraph using a CSS class.</p>
<span class="subtle">Subtle gray text inside a span.</span>

Color values can be named (red), hex (#ff0000), rgb(255,0,0), rgba(255,0,0,0.8) or hsl(0,100%,50%). Always check contrast for accessibility; see MDN: color and use a contrast checker like WebAIM Contrast Checker. For the separate C++ runtime question, follow 's advice and post it in the C++ forum so it gets the right attention.

Recommended Answers

All 3 Replies

<p style="color:purple">A paragraph</p>

<p style="color:purple">A paragraph</p>

thank you for the reply.

i have another problem

i hope you can help me

regarding computing the running time of a program in C++ environment
the specification is like this: i will make a program that can read another
file which is a program too in C++.

I would like to compute the main() alone of the file.
do you have an algorithm on how to solve this problem?

and how to control the reading of the file line by line?is it possible?

thnks.

Enter your question in the C++ forum. This forum is for HTML and CSS only.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.