CSS - Background properties

0 votes
597 views
added Jul 18, 2018 in CSS by LC Marshal Captain (25,790 points)
/*transparent #000 in rgba*/
.background {
    background: rgba(0, 0, 0, 0);
}
 
 
/*bg fr body */
background-image: url("../images/e7b335f7-pexels-photo-122244-large.jpeg");
background-repeat: no-repeat;
/*background-position: right top;*/
background-attachment: fixed;
 
/*gradient position*/
background: linear-gradient(45deg, red, blue);
background: linear-gradient(135deg, orange, orange 60%, cyan);
/*Learn more here: https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient*/
 
 
/*100% width and height minus specific size*/
min-height: calc(100vh - 64px);
max-height: calc(100vh - 64px);
 
/*Background-cover*/
.background-cover{
  backgrobund: url('https://s-media-cache-ak0.pinimg.com/736x/71/ca/46/71ca46ee76ba28ec1898d22db930d066--pink-houses-dream-houses.jpg') no-repeat fixed; 
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
 
/*shadow style*/
input[type=text] {
  &:focus {
    box-shadow: 0 0 10px #ffac32;
  }
}
/*faded black from bottom to top*/
  background-color: rgba(0,0,0,0.16);
  background-image: -moz-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.4));
  background-image: -webkit-gradient(linear, 0 0, 0 100%, from(rgba(0,0,0,0)), to(rgba(0,0,0,0.4)));
  background-image: -webkit-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.4));
  background-image: -o-linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.4));
  background-image: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.4));
  background-repeat: repeat-x;
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#66000000', GradientType=0);
  background-color: transparent;

 

3 Responses

0 votes
responded Jul 18, 2018 by LC Marshal Captain (25,790 points)
/*If you do not need to add a border on columns, you can also simply add a transparent border on them*/ 
[class*="col-"] {
  background-clip: padding-box;
  border: 10px solid transparent;
}

/*To force the child element to follow the parent container*/
box-sizing: border-box;

 

0 votes
responded Aug 24, 2018 by LC Marshal Captain (25,790 points)
// to add filter on top of background image
box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.59);
background: url("http://site.com/images/buy_bg.jpg") no-repeat center;

 

0 votes
responded Oct 16, 2018 by LC Marshal Captain (25,790 points)

Background cover 

background: url($assets-folk-pattern-png) no-repeat center;
background-size: cover;

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...