FCC—Create Texture by Adding a Subtle Pattern as a Background Image_早秋_前端开发者

One way to add texture and interest to a background and have it stand out more is to add a subtle pattern.

The key is balance, as you don’t want the background to stand out too much, and take away from the foreground.

The background property supports the url() function in order to link to an image of the chosen texture or pattern.

backgroundurl()

The link address is wrapped in quotes inside the parentheses.

 

练习题目:

Using the url of https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png, set the background of the whole page with the body selector.

https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.pngbackgroundbody

 

练习代码:

<style>
  body {
    background: url(https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png);
  }
</style>
<style>
  body {
    background: url(https://cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png);
  }
</style>


body {
background: url(https:
//cdn-media-1.freecodecamp.org/imgr/MJAkxbh.png); }

 

效果:

 

» 本文来自:前端开发者 » 《FCC—Create Texture by Adding a Subtle Pattern as a Background Image_早秋_前端开发者》
» 本文链接地址:https://www.rokub.com/73834.html
» 您也可以订阅本站:https://www.rokub.com
赞(0)
64K

评论 抢沙发

评论前必须登录!