Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 1.57 KB

clv5of184000709mnaclwf588.md

File metadata and controls

47 lines (31 loc) · 1.57 KB
title datePublished cuid slug
The Style Attribute
Thu Apr 18 2024 20:10:41 GMT+0000 (Coordinated Universal Time)
clv5of184000709mnaclwf588
the-style-attribute

With the style attribute, you can fully customize the visual presentation of your websites, from typography and colors to layout and more.

<p style="color:green">Green paragraph.</p>

The style attribute can be used to define properties like color, font size and alignment.

The style attribute can make your life a whole lot easier when it comes to formatting. You can customize multiple properties at the same time. Just separate each property:value pair with a semicolon (;).

<h1 style="color:blue ; text-align:center">Centered BlueHeading </h1>

You can control the font size with the font-size property.

The background-color property is useful for styling elements like the button.

The border property require multiple values.

The border property is a short and simple way to refer to 3 different sub-properties. That’s why it can take 3 values.

  • border-width

  • border-style

  • border-color

The only required border sub property is border-style. If the width is not specified, the default value will be “medium”. If color is not specified, the color of the text will be applied to the border.

    <h2 style="border:dotted">dotted</h2>
    <h2 style="border:dashed">dashed</h2>
    <h2 style="border:solid">solid</h2>
    <h2 style="border:double">double</h2>
    <h2 style="border:inset">inset</h2>
    <h2 style="border:outset">outset</h2>