Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

closed Change the color of the text

+6 votes
asked Apr 23, 2020 by Mariana3299 (180 points)
closed Dec 20, 2022 by Admin
How do you change the color of the text?
closed with the note: closed

6 Answers

+2 votes
answered Apr 23, 2020 by Jerson Dayuday (180 points)
<h1 Style = "color :white">Hello World!</h1>
commented Apr 24, 2020 by Ashrith Annamreddy (410 points)
That's for html. You need to specify what coding language you want to change the color of the text in
+1 vote
answered Apr 23, 2020 by QuiiKy _ (460 points)
In short:

you can't change colors of text on this compiler.
0 votes
answered Apr 24, 2020 by partheshsingh (150 points)
depends upon the programming language you are coding on.
+2 votes
answered Apr 26, 2020 by LiOS (6,420 points)
Depends on the language and there are many different methods. Colour can be changed in this compiler.

One method in C:

#include <stdio.h>

int main () {
    
    printf("\033[1;31m");   // set colour to red
    printf("Hello world\n");
    printf("\033[0m"); // set colour to white
 
    return 0;
}
commented Mar 12, 2021 by SUBODH SINGH (110 points)
Sir what If I want to change the colour of the console
commented Nov 23, 2021 by Nysa Delos Reyes (100 points)
have you found a way to change the color of the console?
commented Jan 30, 2022 by YIHAO CHEN (110 points)
Then check if you made an error in the code.
commented Jan 17 by Ryan Greeney (100 points)
How do I use a color other than red?
0 votes
answered Dec 17, 2022 by Elijah Bingham (140 points)
reshown Dec 20, 2022 by Admin
So i did it with any program that has the system() command

here is a proof of concept for  python

https://onlinegdb.com/JnxPM3nEQ
0 votes
answered Dec 20, 2022 by Kandheri Sidharth (140 points)

There is a diff ways to change a color of a text.In diff languages the syntax may be vary.Here I was changed the text color using HT ML and CSS .

<h1 style="color:blue">Hello There</h>

<style>

   h1 { 

        color:black;

       }

</style>

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...