HTML CSS usage and style tags and attributes

CSS (Cascading Style Sheets) style for rendering HTML element tags.

CSS can be added to HTML in the following ways:

  • Inline styles: Use the "sytle" attribute in HTML elements
  • Internal stylesheet: HTML document head <head> region using <style> element to contain CSS
  • External references: Use external CSS file

The best way is through external CSS file references.

This article focuses on adding inline CSS styles to HTML.

Inline style

When a particular style needs to be applied to the individual elements, you can use inline styles. The method of using the inline style is to use a style property associated Tags. Style attribute can contain any CSS property. The following example shows how to change the color of the paragraph and text alignment:

<p style="color:green;text-align:center;">该段落演示居中对齐</p>

CSS properties (style property of the list)

Information Reference: https://www.ggbiji.com/css-attribute.html

Published 39 original articles · won praise 8 · views 9193

Guess you like

Origin blog.csdn.net/cxd3341/article/details/100191035