- HTML (Hypertext Markup Language): It is a markup language used to give structure to the website content. For example, defining paragraphs, headings, subheadings, incorporating images, embedding videos, and more.
- CSS (Cascading Style Sheets): Using CSS, we can style the content of the web pages. Styling of the content includes setting colors to the text, applying background color to the web page, and more.
- Making web pages interactive
- Creating mobile applications
- Creating browser-based games
- Used in back-end infrastructure
- It is a very simple language to learn.
- The language is very popular and is used almost everywhere on the web.
- It works along well with other languages.
- It allows us to develop high-quality interfaces.
- Open your web browser whether it is Chrome or Firefox.
- Open a new tab in the browser.
- In the new tab, right-click and choose “Inspect”.
- Once you do that, a developer tools section opens. In that section, you will find the “Console” tab. Open it. Here you will find some text, clear that.
- First, open the notepad on your Windows.
- In the notepad write some basic HTML code.
- Open the Visual Studio Code. In the application, open a new file.
- Save the file with extension ”.html”.
- To execute the HTML file, you can either copy the file and drag and drop it onto the browser or double-click the file to run the code.
To change the font color of a text, you need to use the fontcolor() method. Using this method causes the text to change the color specified in the method. The fontcolor() method generates a font HTML element where the text is displayed in the specified font color.
The syntax is string.fontcolor(color-value) and the parameter “color-value” in the syntax is where the color name is used to display the string in that color. You can also use a hexadecimal RGB triplet as a color value. If using a hexadecimal RGB triplet value, then you need to use the format “rrggbb”.
<title>To Change The Font Color Of “Hello World” To Red</title>
<h1> Font Color Method</h1>
<p1> We will see the font color of the text “Hello World” changing to red <br></p1>
var stringcolor = “Hello World”;
The above example script showcases how you can use the fontcolor() method to change the font color of the text to your desired color.
To Sum Up