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

HTML

How do i center the arrow?

i want to place an arrow icon below the h1 in header and have the nav links to be displayed below that which can fill up the header equally

1 Answer

If you're using an actual icon, you can center it like any other text using the CSS text-align property:

span.icon {
  text-align: center;
}

If you're using an image, you'll want to use margins of auto for the left and right properties:

img.icon {
  margin-right: auto;
  margin-left: auto;
}

Or wrap it with a new div or whatever, if appropriate and use one of the code above.