So let’s say you have a HTML paragraph tag with id “mytext” as shown in the below snippet.
<p id="mytext">This is HTML interview questions.</p>
You can create a style using “#” selector with the “id” name and apply the CSS value to the paragraph tag. So to apply style to “mytext” element we can use “#mytext” as shown in the below CSS code.
<style>
#mytext
{
background-color:yellow;
}
</style>