/* This is a single-line comment */
  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position
  • background (shorthand property)
  • Example

    Set the background image for a page: 

    body {

    Position the background image in the top-right corner: 

    body {
      background-image: url(“img_tree.png”);
      background-repeat: no-repeat;
      background-position: right top;
  • background-attachment: fixed;
  • PropertyDescription
    backgroundSets all the background properties in one declaration
    background-attachmentSets whether a background image is fixed or scrolls with the rest of the page
    background-clipSpecifies the painting area of the background
    background-colorSets the background color of an element
    background-imageSets the background image for an element
    background-originSpecifies where the background image(s) is/are positioned
    background-positionSets the starting position of a background image
    background-repeatSets how a background image will be repeated



    Specifies the size of the background image(s)


    Demonstration of the different border styles:

    p.dotted {border-style: dotted;}
    p.dashed {border-style: dashed;}
    p.solid {border-style: solid;}
    p.double {border-style: double;}
    p.groove {border-style: groove;}
    p.ridge {border-style: ridge;}
    p.inset {border-style: inset;}
    p.outset {border-style: outset;}
    p.none {border-style: none;}
    p.hidden {border-style: hidden;}
    p.mix {border-style: dotted dashed solid double;}
    heightSets the height of an element
    max-heightSets the maximum height of an element
    max-widthSets the maximum width of an element
    min-heightSets the minimum height of an element
    min-widthSets the minimum width of an element
    widthSets the width of an element
Screenshot 116