Finishing CSS properties: background, text, font

Since finishing rookie tutorial aimed at easy access.

background

  • background-color: Define the elements of the background color
  • background-image: The background image of the specified element, default is tiled repeatedly displayed
  • background-size: Set the background image size
    • length: The first value width, the height of the second value is set; if only one value is given, as the secondauto
    • percentage: Setting a location area percentage relative to background, the same width and height of the two values
    • cover: Maintaining the aspect ratio, background scaled to completely cover the location area minimum size
    • contain: Keep aspect ratio, zoom into the background positioning area for the maximum size
  • background-repeat: How to set the background image tiling
    • repeat: Repeat (default)
    • repeat-x: Only the horizontal position of the background image will be repeated
    • repeat-y: Only the vertical position of the background image will be repeated
    • no-repeat
  • background-attachment: Set a fixed or rolling
    • scroll: With the page scrolling and scrolling (default)
    • fixed: Fixed and does not scroll
    • local: With the rolling element's content is scrolled
  • background-position: Starting position for the background image
    • left top, left center, left bottom... 9 position
    • x% y%The upper left corner is 0% 0% 100% 100% lower right corner
  • background: Shorthand properties
background: #00ff00 url('smiley.gif') no-repeat fixed center; 

text

  • color: Set Color
  • text-align: Sets the horizontal alignment
  • vertical-align: Set the vertical alignment
    • baseline: Parent element is placed on the base (default)
    • top: The top row to the top element is aligned with the highest
    • text-top: The top of the parent element's font tip alignment
    • middle: Placed in the middle of the parent element
    • bottom: Top and bottom row of elements aligned with the lowest
    • text-bottom: Font bottom reaches the bottom of the parent element is aligned
    • %: The use of high percentage values ​​are arranged in rows
  • text-decoration: Text decoration, often used to remove links underscore
    • none: No frills
    • overline: On the dash (?)
    • line-through: Strikethrough
    • underline: Underline
  • text-transform: For case conversion, or the first letter capitalized
    • uppercase
    • lowercase
    • capitalize
  • text-indent: Indent first line of the text, if you want to achieve two blank spaces at the beginning of the paragraph can be set to 2em
  • letter-spacing: Character Spacing
  • line-height: Row Height
  • white-space: Set how to handle the blank
    • normal: By default, ignoring white space, line breaks invalid
    • pre: Leave blank, reference <pre>label
    • nowrap: The text does not wrap until it encounters brthe tag
    • pre-wrap: Blank character sequence, the normal line feed
    • pre-line: Merge blank character sequence, the normal line feed

Fonts

Click here to remember font-sizethe three units, pxspecifies the actual pixel size; emspecifies the size relative to the parent element; remspecifies the relative size of the HTML root element, more normative.

Guess you like

Origin www.cnblogs.com/zzzt20/p/12405320.html