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)
- Content-align = left : the cross shaft is not occupied in the elastic container aligned (vertically) in the container when all the available space;
- items-align = left : define flex children aligned on the front side of the flex shaft line of the container (vertical axis) direction;
- Self-align = left : children flex separately defined on the side of the alignment axis (longitudinal) direction;
- All : Reset all attributes (except unicode-bidi properties and the direction property)
- Animation : is a shorthand property for setting six animation properties;
- animation-delay after the start of the animation defined number of seconds (s) or milliseconds (ms);:
- direction-Animation : Defines whether cyclically alternating reverse play the animation;
- DURATION-Animation : Animating a complete cycle takes much time;
- Fill-MODE-Animation : when the animation is not a predetermined play (when the animation is completed, or when there is a delay animation playback does not start), the style element to be applied;
- the Iteration-COUNT-Animation : Set how many times the animation should play;
- name-Animation : Set the name of @keyframes animation;
- Play-State-Animation : specify the animation is running or paused;
- Timing-function-Animation : how to specify the animation will complete a cycle;
- the Appearance : allows you to make the elements look like a standard user interface elements;
- -visibility backface : Set when the element is visible when the screen is not facing the back of the display is not often used at the time of rotating elements;
- background : Background attributes defined for the element;
- Attachment-background : set whether the background image fixed or rolling;
- Blend-MODE-background : set the blending mode of the background layer;
- Clip-background : Specifies the background drawing area;
- Color-background : The background color setting element, the background elements is the total size of the element;
- Image-background : background image element;
- Origin-background : background-position attribute should specify the relative position;
- position-background : setting the starting position of a background image;
- REPEAT-background : setting whether to repeat the background image and how to repeat a background image;
- size-background : Specifies the size of the background image;
- border : simultaneously define a plurality of border attribute is a shorthand property;
- -bottom border : attribute defines the bottom border element;
- Color-bottom-border : define a bottom border color;
- -bottom-left-border RADIUS : define the shape of the lower left corner of the frame;
- -bottom-right-border RADIUS : defining the shape of the bottom right corner of the frame;
- -style bottom-border : the element is provided at the bottom border style;
- bottom-width-border : the element's bottom border width;
- Collapse-border : the border table is arranged into a single frame, or displayed separately;
- Color-border : four border color setting element, you can have one to four values;
- Image-border : set a picture as the border;
- Image-OUTSET-border : a predetermined amount of the frame image over the border of the housing;
- Image-REPEAT-border : setting image border repeats, stretching or covered;
- Image-Slice-border : boundaries of the designated image offset inwardly;
- Image-Source-border : specify the image frame to be used, if the value is set to "none" or the image can not be displayed, border style will be used;
- Image-width-border : setting the width of the boundary of the image;
- border-left:
- Color-left-border : Set the color of the left border of an element;
- left-style-border : set the style elements of the left border;
- left-width-border : set the width of the left border of the element;
- RADIUS-border : setting rounded corners;
- right-border : the left border attribute set to a statement;
- Color-right-border : Set the right border of the color of the element;
- -right-style border : Set the right border style elements;
- -right-width border : Set the right border width of the element;
- spacing-border : set the table rows and border of the cell pitch in the lateral direction (horizontal) and portrait (vertical);
- -style border : set the style of the border element;
- Top-border : all the attributes on the element border to define a declaration;
- Top-Color-border : Set the top border of the color of the element;
- Top-left--border RADIUS : the upper left corner of the border of the element is rounded borders;
- Top-right--border RADIUS : a border element is set to the upper right corner rounded corners;
- Top-style-border : Set the top border style element;
- Top-width-border : the element's top border width;
- -width border : right and left vertical element border width;
- bottom : a positioning element to move from the bottom;
- align = left-box : How to set the box sub-elements are aligned;
- direction-Box : subelement predetermined frame elements are arranged in what direction;
- Flex-box : the specified child element is flexible or fixed box size;
- Flex-Group-Box : using the packet assigned to the flexible telescopic elements;
- Lines-Box : If the column exceeds the predetermined space of the parent frame, whether to wrap the display, a new layout elastic properties cartridge;
- ORDINAL-Group-box : box using a predetermined sequence of display sub-elements;
- Orient-box : Specifies whether a sub-element box arranged horizontally or vertically should
- Pack-Box : when the block is greater than a predetermined size of the sub elements, where to place sub-elements;
- Shadow-Box : layout used in the flexible pouch, to add one or more of the shaded box;
- Sizing-Box : allows you to define certain elements in some way to adapt to the designated region;
- Side-Caption : The table headings provided below the table;
- Clear : Clear float, is to the left or right side of the floating element Elements as block floating elements are not processed;
- Clip : shape element is set, cut or absolute positioning element fixed positioning is actually retrieved or set the viewable area of the object;
- Color : the color of the text, the color of the color of the text defaults to black (# 000);
- COUNT-column : The content elements split into specified number of columns (multi-column layout);
- column-Fill : is the use of columns, column-count and other attributes are provided a plurality of columns (multi-column layout) in the element, its role is the control element is divided into several columns, the content inside will be how to allocate the respective columns;
- GAP-column : the distance between the element's content (multi-column layouts) after column to column breakdown;
- rule-column : the style between the column and row, width, color, while the definition in a statement;
- Color-rule-column : column to column is provided between the color dividing lines;
- rule-style-column : styling between the columns;
- rule-width-column : set the width between the column and the dividing line of the column;
- span-column : Sets the element multi-column layout how many columns cross;
- width-column : width plurality of rows of columns in the layout;
- Columns : The column-width, column-count two attributes defined in a statement;
- Content : and: before and: after pseudo-element used in conjunction with content generated using insert;
- INCREMENT-counter : Set a counter is incremented at each occurrence is selected, the default increment is 1, and is generally used to counter-reset properties and content property is used together;
- RESET-counter : to create one or more counters or reset, and the counter-increment commonly used attributes and content attributes used together;
- Cursor : to set the mouse cursor / shape of the pointer on the specified element;
- direction : right alignment used to achieve effects and changes inline element block;
- the display : box element type is used to be generated is defined;
- cells-empty : to set whether to display the empty cells in the table (including the border and background);
- filter : used to define the elements of visual effects, and saturation typically used to blur the image defined;
- Flex : used to set or retrieve the sub-element cassette elastic model how to allocate space object;
- Basis-Flex : retrieve or to set the reference value retractable flexible pouch, the flexible pouch works only on the object, does not work for the other elements;
- direction-Flex : using a flexible project a predetermined direction, the elastic element must be used in the boxes of the objects, for other elements, flex-direction property does not work;
- Flow-Flex : used to set or retrieve the flexible pouch model object sub-element arrangement, the resilient element must be used in the boxes of the objects, does not work for the other elements;
- Grow-Flex : used to set or retrieve the expansion ratio of the elastic box, the box must be used in the elastic element object, otherwise there is no effect;
- Shrink-Flex : shrinkage ratio is used to set or retrieve the flexible pouch, the flexible pouch rule specifies shrinkage;
- wrap-flex : flex container using a predetermined single-line or multi-line is, while the horizontal axis direction, determines the direction of the new line are stacked;
- a float : defines the floating element;
- font : used to set the text font, size, style and text style;
- @ font-face :
- font-family:
- font-size:
- font-size-adjust:
- font-stretch:
- font-style :
- font-variant:
- font-weight:
- grid-columns:
- grid-rows:
- hanging-punctuation:
- height:
- icon:
- justify-content:
- @keyframes:
- left:
- letter-spacing:
- line-height:
- list-style:
- list-style-image:
- list-style-position:
- list-style-type:
- margin : to set the margins, comprising margin-bottom, margin-left, margin-right, margin-top, vertical and horizontal margins can be set simultaneously;
- margin-bottom:
- margin-left:
- margin-right:
- margin-top:
- max-height:
- max-width:
- @media:
- min-height:
- min-width:
- nav-down:
- nav-index:
- nav-left:
- nav-right:
- nav-up:
- opacity:
- order:
- outline:
- outline-color:
- outline-offset:
- outline-style:
- outline-width:
- overflow:
- overflow-x:
- overflow-y:
- padding:
- padding-bottom:
- padding-left:
- padding-right:
- padding-top:
- page-break-after:
- page-break-before:
- page-break-inside:
- perspective:
- perspective-origin:
- position:
- punctuation-trim:
- quotes:
- resize:
- right:
- rotation:
- tab-size:
- table-layout:
- target:
- target-name:
- target-new:
- target-position:
- align = left-text : horizontal alignment of the text;
- text-align-last:
- Decoration-text : definition to the modified text;
- text-decoration-color:
- text-decoration-line:
- Decoration-style-text : set the text to decline line style;
- indent-text : the text block a predetermined first indented line of text;
- text-justify:
- text-outline:
- overflow-text : Specifies the text overflows the containing element, how to display;
- Shadow-text : text shadow set;
- Transform-text : the definition of the case of letters in the text;
- wrap-text : custom text wrap (wrap) rules;
- Top : the definition of a positioning element comprising on its outer offset from the boundary between the block boundary;
- Transform : a 2D or 3D conversion element;
- transform-origin:
- transform-style:
- Transition : over four properties defined;
- Delay-Transition : defines how long to delay the start switching effect;
- DURATION-Transition : define the transition effects to be duration;
- Property-Transition : attribute name css defined transition effects applied;
- Timing-function-Transition : defines the transition effect speed profile;
- BIDI-Unicode : Sets or returns whether text is overwritten;
- align = left-Vertical : element defines a vertical alignment;
- visibility : definition of whether an element is visible;
- Space-White : gaps in the definition of how to deal with the element;
- width : the width of the elements is defined;
- BREAK-Word : processing method defined wrap;
- word-spacing occupied space defined text character (blank character string enclosed) increases or decreases the blank between the word and, in fact, define the text in whitespace;:
- wrap-Word : long wrap may define the content;
- index-Z : stacking order of the elements is defined;
Information Reference: https://www.ggbiji.com/css-attribute.html