This article mainly introduces the background settings and text appearance attributes in CSS. It has certain reference value. Interested friends can refer to it. I hope it will be helpful to you!
css background representation: strong>
1: background-color: background color word, rgb representation Method, hexadecimal notation
2: background-image: If the background image is not set, it will be flat.
p {
width: 500px;
height: 500px;
background-image: url(images/wuyifan.jpg);
}
3: background-repeat: Set whether the background image is repeated in a repeating manner.
a: background-repeat:no-repeat; Do not repeat
b: background-repeat:repeat- x; Horizontal repeat
c:background-repeat: repeat-y; repeat vertically
Tips: Yes Use 1-pixel or periodic images as tile backgrounds for web pages
css length unit:
— px: pixel, a pixel is a point displayed on the monitor
— em: 1em=16px
TIPs: For computers with higher resolution, how many dots are used to represent one pixel, the color display will be more detailed and the effect will be better. The resolution on ordinary computers is that one dot corresponds to one pixel
General text sizes are 12 and 14 px
Text appearance properties:
1: color text color
2: letter-spacing: word spacing, the space between characters
3: word-sapce: word spacing, defining the spacing between English words, for Chinese characters are invalid
4: line-hight: line High, double line spacing at the top of the text ----- the most used, because it can vertically center a single line of text
In order to strictly ensure that the words are centered within the line. Convention: Line height and font size are generally even numbers. In this way, their difference is an even number, which is divisible by 2.
5: text-decoration: used to set text Underline
none: no decoration (a can be removed Underline of label)
underline: underline overline: above Strike through
line-through: strikethrough span>
6: text-align: Set the horizontal alignment of text content , equivalent to the align attribute in HTML
7 : text-indent: first line indent, used to set the indent of the first line of text in a paragraph, can only be set in block-level tags, and can be a negative value , the actual application is to indent the icon text on the website
TIPs: To achieve vertical centering of a single line of text: line-height (line-hight) is equal to the height of the p box.
The above is the entire content of this article, I hope you all like it.
【Recommended tutorials】
1. CSS video tutorial
2. CSS online manual
3. bootstrap tutorial