xFactorSchool.com
Python
JavaScript
How to Do Examples
C Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Compilers
C Compiler
C++ Compiler
C# Compiler
Java Compiler
Python Compiler
HTML Code Editor
CSS Code Editor
JavaScript Compiler
JavaScript Code Editor
Practice how to apply internal CSS style to HTML elements using HTML id in an HTML page
HTML Online Editor
Run Code
More HTML Sample Codes
<!DOCTYPE html> <html> <head> <title>HTML ID for CSS Style in HTML Page</title> <!-- Title of the page--> <!--This is an example of internal css style.--> <style> /*This is an example of HTML id to apply CSS style. # is used to define id. */ #testId { color: red; font-size: 18px; } </style> </head> <body> <h1>Example of HTML ID to Apply CSS Style in a Webpage</h1> <hr /> <h3>CSS style element added in the head element. Color and font size of the following lines have been changed using HTML id as selector.</h3> <p id="testId">You can use HTML id as selector in <style> element within head element to apply CSS style.</p> <p>#testId{"color: red; font-size: 18px;"} is used in the style element within the head element to apply CSS style to all elements with id="testId" attribute in the document.</p> </body> </html>