Fade bottom or top of text in a div

Abe Fehr

I'd like to create a list with a particular size, but it's contents can be larger than the list.

I thought it would be real nice looking if the list had items in it and they faded out at the bottom and the top, while having a background image for the container that also contains the list. This is proving harder than expected, and I'm having a difficult time finding an appropriate guide for such a thing.

The images below shows the expected result

enter image description here

Is this even possible? Thanks in advance.

Edit:

  • I've looked at this and this, but I can't use those techniques because there's a background image in the background, not a solid color
Samuel Cook

I was able to get an ugly prototype together. This only works with -webkit- browsers (Chrome, Safari, etc), but it might point you in the right direction and help you adapt to get it cross browser compatible.

.con{background:#0f0; color:#fff;}
ul{margin:0; padding:0; list-style:none; -webkit-mask-image: -webkit-gradient(linear, left top, left bottom,  from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));}
<div class="con">
    <ul>
    	<li>thing1</li>
    	<li>thing2</li>
    	<li>thing3</li>
    	<li>thing4</li>
    	<li>thing5</li>
    	<li>thing6</li>
    </ul>
</div>

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Top div cover text in bottom div

From Dev

How to fade in from bottom to top

From Dev

How to fade out SnackBar bottom to top

From Dev

Fade in div with text

From Dev

fade line on top and right of div

From Dev

Have text-div aligned right bottom on top of image

From Dev

Align on top and on bottom in the DIV

From Dev

Fix div at top and bottom

From Dev

Fade in and Fade Out Text in DIV - Remove Loop

From Dev

How to fade out text on top of semi-transparent div using CSS?

From Dev

How to fade out text on top of semi-transparent div using CSS?

From Dev

Align div from bottom to top

From Dev

Rotating Div from bottom to top

From Dev

Div with double arrow on top and bottom

From Dev

Div with double arrow on top and bottom

From Dev

Fade and translate the "position:absolute" element from top to bottom using jquery

From Dev

ios uitableview fade bottom cell and top cell as you scroll

From Dev

iOS 7 navigationbar barTintColor - able to have it fade from top to bottom?

From Dev

Top & bottom bars fade in and out during activity transition animation

From Dev

iOS 7 navigationbar barTintColor - able to have it fade from top to bottom?

From Dev

ios uitableview fade bottom cell and top cell as you scroll

From Dev

Center a text at the bottom of a div

From Dev

Faded text at bottom of div?

From Dev

Text starts at bottom of div

From Dev

jQuery div fade text only, keep the div

From Dev

Top and Bottom border in CSS doesn't align text vertically inside a <div> tag

From Dev

How can I fade in and then fade out text inside a <div>

From Dev

How can I fade in and then fade out text inside a <div>

From Dev

Text will not align to top of div

Related Related

HotTag

Archive