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 trialpgmd
6,897 PointsClear float
My elements are not lining up next to each other. Thank you for the help.
<div class="arrow-right-button">See resume Content <div class="arrow-right">»</div></div>
.arrow-right-button {
float: right;
width: 200px;
background-color: cyan;
border-radius: 10px;
border-bottom-style: groove;
font-family: Arial, sans-serif;
font-weight: bold;
font-size: 16px;
text-align: left;
margin-right: 10px;
padding: 10px 0 10px 10px;
}
.arrow-right {
color: red;
font-size: 28px;
float: right;
display: inline;
margin-left: 15px;
margin-right: 20px;
}
1 Answer
Dave McFarland
Treehouse TeacherMove this <div class="arrow-right">»</div>
to the beginning of the div:
<div class="arrow-right-button"><div class="arrow-right">»</div>See resume Content</div>
HTML that comes BEFORE a floated element, never wraps around the floated element. Because you put the right arrow AFTER "See resume content", that text couldn't wrap around the arrow. However, moving the arrow before the text, lets the text that follows wrap around the arrow.
Dave McFarland
Treehouse TeacherDave McFarland
Treehouse TeacherHi,
Your HTML code wasn't showing up correctly. I fixed it in your post.
For the future, to put HTML/CSS/JavaScript in a forum post:
hit return to create a new line and type three back tick characters ```
hit return to create another new line and paste your HTML
hit return and add three more back tick characters: ``` The back tick character isn't the same as the single quote -- ' -- mark; the back tick is located on the same key as the ~ on most keyboards.
Also to add correct color highlighting add the name of the language after the back ticks like this: ```CSS. Here's what CSS should look like in a forum post: