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 trialJohnathan Rowley
3,842 Pointsquestion
how to align with text using css
3 Answers
Jon Knight
7,184 PointsUse text-align: [left]-[center]-[right]-[justify] etc..
like this
#myDiv{
text-align:left;
}
Samiruddin Syed
3,136 PointsWhere ever you want to align the text, for example if the id of that particular div is : myDiv, then your CSS will look like :
#myDiv{
text-align:left;
}
Note : The above code aligns the text inside the div to the left. If you want to align to right, then use "right", and "center" for center and "justify" for justifying the text in the div.
Hope that helps.
Patrick Lamb
4,285 PointsYou can also align the text vertically with:
vertical-align:top
Or use bottom, middle
You can find more info here: http://www.w3schools.com/cssref/pr_pos_vertical-align.asp