CSS basic tutorial background properties

CSS background properties

  • background-color: background color.

  • background-image: background image address. For example: background-image:url(images/bg.gif)

  • background-repeat: background tiling mode, value: no-repeat (not tiling ), repeat-x (horizontal direction), repeat-y (vertical direction)

  • background-position: background positioning. Format: background-position: horizontal positioning, vertical positioning;

  • ## Use English words to position: background-position: left|center|right top| center|bottom;

  • Use fixed value positioning: background-position: 50px 50px; //The background is 50px from the left side of the container and 50px from the top of the container

  • Use percentage positioning: background-position: 50% 50%; //Horizontally centered, vertically centered

  • Use mixed positioning: background-position: left 10px; //Background to the left All together, 10px from the top of the container

  • Abbreviation

  • background: background color background image Tiling method Positioning method;

    ## Example: background:url(images/bg.gif) no-repeat center center;
  • Example: background: #ccc url(images/bg.gif) no-repeat left 10px;
  •     php.cn  
    

    习近平心中的互联网

    互联网是20世纪最伟大的发明,它正在将人类“一网打尽”,人们在不知不觉中已经融入了互联网生态,互联网让世界变成了“鸡犬之声相闻”的地球村。

Continuing Learning
||
php.cn

习近平心中的互联网

互联网是20世纪最伟大的发明,它正在将人类“一网打尽”,人们在不知不觉中已经融入了互联网生态,互联网让世界变成了“鸡犬之声相闻”的地球村。

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!