HTML Style
Styles in HTML are describe how a document will be presented in a browser. Setting the style of an HTML element, can be done with the style attribute.
There type of style in HTML :
Inline Style : In this method, the style attribute is used inside the HTML start tag.
Embedded Style : In this method, the style element is used inside the
element of the document.External Style Sheet : In this method the <link> element is used to point to an external CSS file.
Inline style example<!DOCTYPE html> <html> <body> <h1 style="color:green;font-size:20px;"> Welcome to JAVAMEANT</h1> <p style="color:red;font-size:30px;"> paragraph</p> </body> </html>
Embedded Style example
<!DOCTYPE html> <html lang = "en"> <head> <style type = "text/css"> body { background-color : green; } h1{color:red; font-family : arial;} p{color:black; font - family : verdana;} </style> </head> <body> <h1>welcome to javameant</h1> <p>paragraph.</p> </body> </html>
External Style Sheet example
<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="/externalstyle.css"> </head> <body> <h3>External Style Sheet Example</h3> </body> </html>
© copyright 2017-2022 Completedone pvt ltd.