Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Style Attribute
Style Attribute

style attribute is used to set the style of HTML element it is used in CSS to make different styles of element, it is used as inline attribute within any HTML element

Syntax

<tag style=some styles>Content</tag>


Here some styles means you can give any number of styles to HTML element and each style has following syntax.


Example

I am red heading


Styles are used for decoration of HTML elements


Practice Task

Open notepad or any other text editor, follow the following points.


  • Create any HTML element
  • Use style attribute and give it green color
  • If you are using text then increase font size of text to 20px
  • Use <br /> if neccessary otherwise leave it

save file with name task.html or task.htm and then open it using any browser and see results.


Solution

I am green and 20px large


You can apply any style to your elements.