LoginSignup
0
1

More than 5 years have passed since last update.

CSS 画像を使わずに模様をつくる。

Last updated at Posted at 2016-02-18

sample001.png

グラデーションを利用して模様をつくる。

html


<div class="wrap"></div>

CSS


.wrap{
  /* 任意のサイズ */
  width: 100%;
  height: 100%;

  /* 背景模様 */
  background-image: 
    linear-gradient(to left,   transparent 100px, blue),
    linear-gradient(to bottom, transparent 100px, green);

  /* 背景画像サイズ 幅,高さ */
  background-size: 102px 102px;

  /* 背景画像を繰り返し表示 */
  background-repeat: repeat;
}

グラデーションを指定する

background-image: 
    linear-gradient(to left,   transparent 100px, blue),
    linear-gradient(to bottom, transparent 100px, green);

指定したグラデーションのサイズを指定

background-size: 102px 102px;

グラデーションを繰り返し表示させる

background-repeat: repeat;
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1