Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

an unordered list background filled with 2 colors equally - CSS

I need to fill the background of an unordered list equally with black and white sharp colors. How-to? No gradients, just 2 colors filling each 50%, horizontally the background of the unordered list.

Thank you.

2 Answers

I found this solution, as it is horizontally that i need it and not vertically.

background: linear-gradient(to right, black 0%, black 50%, white 50%, white 100%); 

This code will make it horizontally.

ul {
    background: -webkit-linear-gradient(0deg, black 50%, white 50%);
    background: linear-gradient(0deg, black 50%, white 50%);
}