HTML Style individual nodes (size, background color) using notepad 2021

HTML Styles: 

Learn HTML Full language

  • HTML Stands for HyperText Markup Language and it is mostly used in the creation of websites.
  • We can make the style i.e, size of the word which we want to get the output. 
  • We can change the size, background color, Text color, Font,  Text Alignment.
  • style element is used to change the style of the text.
  • background-color element helps in changing the background color in HTML.
Source code: 

<body style="background-color:lightgreen;">

<h1>This is a heading</h1>
<p>This is a paragraph.</p>


Expected Output: 


  • We can also change the back-ground color for heading and paragraph if we want to change by using <p> tag as we discuddes in earlier blog.
  • color property changes the text color in HTML.
Source code: 


<h1 style="color:pink;">This is a heading</h1>
<p style="color:yellow;">This is a paragraph.</p>


Expected Output: 

  • For text fonts, use font-family element.
  • For text size, use font-size element.
  • For text alignment, use text-align element.


Steps to Write the code:

Step 1: Open Notepad and type the above code of the paragraph program.

Step 2: Save the file on your computer by clicking the File and click Save As and name the file as per your interest and make sure to name the file as .htm for example abcd.htm

Step 3: Open the saved file and you can get the required output.

Post a Comment

Previous Post Next Post