Search On Google

Saturday, December 29, 2018

Style in HTML

HTML Style:-

Style is attribute to set style of html element.

Setting style syntax is below:

<tagname style="property:value;">

Example 1:Set background color.

<body style="background-color:gray;">
<h1>Heading1</h1>
<p>Paragraph1</p>
</body>

Example 2:- Set text color
<h1 style="color:blue;">This is a heading</h1>

Example 3:- Set font family
<p style="font-family:arial;">This is a paragraph.</p>

Example 4:- Set font-size
<h1 style="font-size:100%;">This is a heading</h1>


Try HTML Style Example in Editor

No comments:

Post a Comment

About Me

My photo
Mumbai, Maharashtra, India