CSS (Cascading Style Sheets) is used to render the style of HTML element tags. Manipulate Text Colors, Boxes And more… CSS was introduced in HTML 4 to better render HTML elements CSS can be added to HTML in the following ways: Inline style-use the “style” attribute in the HTML element Internal stylesheet-in the HTML document header External references-use external CSS files The best way is to reference the CSS file externally. In the HTML tutorial on this site, we use the inline CSS style to introduce the example, which is to simplify the example and make it easier for you to edit the code and run the example online. You can learn more about CSS through the CSS tutorial on this site. Inline styles can be used when special styles need to be applied to individual elements. The way to use inline styles is to use style attributes in related tags. Style properties can contain any CSS property. The following example shows how to change the color and left margin of a paragraph. The background color attribute (background-color) defines the background color of an element: The early background color attribute (background-color) is defined by using the We can use the font-family, color, and font-sizeproperties to define the font style: Instead of using the < font > tag, font-family, color, and font-size attributes are now commonly used to define text styles. Use Text alignment attribute When a single file requires a special style, you can use an internal style sheet. You can do it in the 11.12.1. Look! Styles and colors ¶
11.12.2. How to use CSS ¶
area use element to contain CSS 11.12.3. Inline style ¶
<p style="color:blue;margin-left:20px;">This is a paragraph.p>
11.12.4. HTML style instance-background color ¶
Example ¶
<bodystyle="background-color:yellow;"><h2style="background-color:red;">This is a titleh2><pstyle="background-color:green;">This is a paragraph.p>body>
bgcolor property definition. 11.12.5. HTML style example-font, font color, font size ¶
Example ¶
<h1style="font-family:verdana;">A titleh1><pstyle="font-family:arial;color:red;font-size:20px;">A paragraph.p>
11.12.6. HTML style instance-text alignment ¶
text-align the (text alignment) property specifies the horizontal and vertical alignment of the text: Example ¶
<h1style="text-align:center;">Centered titlesh1><p>This is a paragraph.p>
text-align replace the old label . 11.12.7. Internal style sheet ¶
partially pass