LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

CSS
body {
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkAAAAIAAQMAAABQDEEZAAAACXBIWXMAABYlAAAWJQFJUiTwAAAABlBMVEX////MzMw46qqDAAAArklEQVR4Xu3YqREAAAgEMfpvmkeicUww5yKQG3PZd90nEAgEAoFAIJD/7AWBQCAQCATyJxAIBAKBQCD9CAQCgUAgEEg/AoFAIBAIBNKPQCAQCAQCgfQjEAgEAoFAIP0IBAKBQCAQSD8CgUAgEAgE0o9AIBAIBAKB9CMQCAQCgUAg/QgEAoFAIBBIPwKBQCAQCATSj0AgEAgEAoH0IxAIBAKBQCD96AMEAoFAIBAIVGgFvCospm7kAAAAAElFTkSuQmCC);
  margin: 2rem;
}

.box {
  width: 320px;
  height: 200px;
  border: 2px solid #000;
  margin: 0 auto;
  padding: 1rem;
  overflow: hidden;
}

.box > p {
  margin: 0;
  -webkit-mask-image: -webkit-gradient(linear, left 50%, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
}

Description

How would you fade out the text in the box in a vertical gradient such that the font color is opaque black at the top and fades into 100% transparent when it reaches the bottom?
Term
Wed, 12/27/2017 - 06:43

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv