background-image よく使うパターンをメモ
目的
background-imageで、よく使うパターンをメモ
sample01
slim
.pra
h1 NIKE NIKE NIKE
sass
h1 {
border-bottom: 1px solid black;
background-repeat: no-repeat;
background-size: contain;
background-image: image-url("lego.jpg");
background-position: right bottom;
}
sample02
slim
.pra
h2 NIKE NIKE NIKE
sass
h2 {
text-align: center;
border-bottom: 1px solid black;
background-repeat: no-repeat;
background-size: contain;
background-image:
image-url('lego.jpg'),
image-url('lego.jpg');
background-position:
left bottom,
right bottom;
}
sample03
slim
.pra
.contain
h3 NIKE NIKE NIKE NIKE NIKE NIKE
p
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
br
| Just Do It Just Do It Just Do It Just Do It Just Do It Just Do It
sass
.contain {
background-image: image-url('lego.jpg');
background-position: left top;
background-repeat: no-repeat;
background-size: 40px;
padding-left: 60px;
h3 {
padding-bottom: 10px;
width: 150px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
p {
color: blue;
}
}
Author And Source
この問題について(background-image よく使うパターンをメモ), 我々は、より多くの情報をここで見つけました https://qiita.com/ko8@github/items/281694d2d6b8857aa261著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .