Html Style tags usage areas | CodingSource

Html Style tags usage areas

We use the "style" parameter in the tags to make the output of the codes we write in HTML more attractive and organized. Thanks to the Style parameter, you can change the color, fonts and sizes of our texts, and you can do many functions such as playing with the background colors of our site. For this, we need to write CSS codes inside the style parameter. But instead of using style tags in html, it is more reasonable to use it with a css file for seo compatibility.

HTML Background Color

The background-color attribute defines the background color of an HTML tag. As the value of the background-color attribute, color code or color names can be entered.

Sample ;

<body style="background-color:Aquamarine;">

     <h1>First Paragraph</h1>

     <p style="background-color:white;">Second paragraph.</p>

</body>

In our example, we gave the background-color attribute to the style parameter of our outermost tag, body, and entered "aquamarine" as the value. Another point to note is that since the h1 tag does not have a background color, it takes the value of the top html tag from itself. We have also given the background color to the p tag so that you can distinguish it better. If the label has its own background-color style parameter, it displays it, otherwise it takes the value of its ancestor. The ranking is from specific to general.

Adding HTML text color

The color attribute is used to specify the color of text within an HTML tag. Color code or English color names can be entered as the value of the color attribute.

Sample;

<p style="color:blue;">Text in Blue</p>

<p style="color:red;">Red Color Text</p>

HTML TEXT CHARACTERS | font family

The font-family attribute is used to specify the font of the text in an HTML tag. As the value of the font-family attribute, the names of the fonts are entered. You can search the internet to see which typefaces you can use.

Sample;

<p style="font-family:courier;">Text written in Courier font.</p>

<p style="font-family:verdana;">Text written in Verdana font.</p>

HTML font-size

The font-size attribute is used to specify the size of the text in an HTML tag. As the value of the font-size attribute, you can create units of measurement such as pixels, percentages.

Sample ;

<p style="font-size:small;">Small Font</p>

<p style="font-size:18px;">18px text</p>

HTML text-align

The text-align attribute is used to align text within an HTML tag. As the value of the text-align attribute, you can enter values such as center , left , right , justify , initial .

Sample ;

<p style="text-align:center;">Centered Paragraph.</p>

<p style="text-align:right;">Right-aligned paragraph.</p>

It is possible to apply many different things with style tags and css codes.

Html Codes Related Posts

Newer Post Load More Pages..