HTML Styles
The main aim of all HTML styles elements that putting the general style. We can use these Style attributes directly or indirectly in our pages. We can also use CSS (Cascading Style Sheet ) , but before learning CSS, you need to know the HTML clearly.
Let’s see some example of HTML style :
Style = “background-color : yellow”
Style = “font-size : 10px”
Style = “font-family : Time New Roman”
Style = “font-align : center”
Define Background Color using Style :
We declare the background color of our pages then the style tag define inside the body tag.
Let’s see,
<html> <head><title>Background Color </title></head> <body style = “background-color : Yellow”> <h1> Your Page is yellow color.</h1> </body> </html> |
Save it and open it your browser. You look the page of yellow color.
Font Style :
Now we use style attribute in font. We use font-family, font-color, font-size, font-align.
Let’s see the example :
<html> <head><title>Font Style</title></head> <body> <h1 style= “font-color : Red ; align : center”> Header Text </h1> <p style = “font-color : Yellow; size : 20px; family : Time New Roman ; align : left”> A Text paragraph</p> </body> </html> Output : Save it and open it browser Header Text A Text paragraph |
Written by “Shojib”
No comments:
Post a Comment