How to use inline CSS style for an element in HTML?

HTMLWeb DevelopmentFront End Technology

Use the style attribute to set the inline CSS style. The following is the syntax −

Syntax

<element style="mystyles">

Here, mystyles are one or more CSS properties. Separate them with semicolons.

Example

You can try to run the following code to implement inline CSS style for an element in HTML −

<!DOCTYPE html>
<html>
   <body>
      <h1 style = "color:white;background-color:black">Tutorialspoint</h1>
      <h2>Simply Easy Learning</h2>
      <p>We provide free learning content.</p>
   </body>
</html>
raja
Published on 13-Mar-2018 06:06:32
Advertisements