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

Matthew Clark
Matthew Clark
7,255 Points

Box issue

Hi, I want to make different size colored boxes in a line spaced out differently with with writing. The boxes should be investment opportunities, research, and sell.

I have the following code...

HTML

<div class="index_table"> <div class="ioDiv"> <p class="Investment_opportunities">Investment Opportunities</p> </div> <div class="sellDiv"> <p class="sell">Sell</p> </div> <div class="researchDiv"> <p class="research">Research</p> </div> </div>

CSS

.index_table { font-family: 'Lato', sans-serif; font: white; }

.ioDiv { float: left; display: inline-block; background-color: blue; border: 15px; text-align: center; margin: 15px 1000px 15px 0px; padding-bottom: 250px; }

.Investment_opportunities { top: 75px; }

.sellDiv{ background-color: red; border: 20px; text-align: right; float: right; padding-top: 15px; padding-left: 250px; }

.researchDiv { background-color: orange; float: right; border: 30px; text-align: center; padding-top: 0px; margin: 40px 300px 100px 500px; }

2 Answers

Thas Eagans
PLUS
Thas Eagans
Courses Plus Student 2,533 Points
<div class="ioDiv">Investment Opportunities</div>
<div class="sellDiv">Sell</div>
<div class="researchDiv">Research</div>
.ioDiv { 
float: left; 
width: 30%;
background-color: blue; 
border: 15px; 
text-align: center; 
margin-right: 5%; 
padding-bottom: 250px; 
}
.sellDiv { 
background-color: red; 
width: 30%;
border: 20px; 
text-align: center; 
float: left; 
margin-right: 5%;
padding-top: 15px; 
padding-left: 250px; 
}
.researchDiv { 
background-color: orange; 
float: right; 
width: 30%;
border: 30px; 
text-align: center; 
}

This should get you started in the right direction.

</TREagans>

Matthew Clark
Matthew Clark
7,255 Points

How would I do it if I wanted three equal boxes in row with whites spaces in between them?