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
brandonlind2
7,823 PointsMy footer icon are floated to the left and they shouldn't be. What am I doing wrong?
I was working on a project and my footer worked flawlessly, I started working on another project and the footer ended up on the left. I couldn't find anything wrong with my css, but I copy and pasted the code from my last project's footer that worked to double check and it still floated left. I think something besides the footer css is causing this, but I have no idea what. I'm trying to center two media icons and the bottom of the page. If you you know help would be greatly appreciated. .media-icon is a class embedded in the <ul> of the <footer> list with facebook and twitter icons. The .gallery is embedded in the <ul> of a list in a <section>
main.css
/General/
html {width: 1334px; font-size: 1em;}
img { max-width: 100%;}
body {max-width: 100%; margin: 0 auto; }
header {max-width: 100%; margin: 0 auto;}
nav {max-width: 100%; margin: 0 auto; background-color: lightblue; text-align: center;}
nav ul {list-style: none;}
nav li {display: inline-block;}
footer {text-align: center; clear: both;}
footer ul {list-style: none;}
footer li {display: inline-block;}
.media-icon { width: 20px; height: 20px; margin: 0 5px;}
/home page/
.gallery {margin: 0 auto; list-style: none;}
.gallery li {float: left; width: 45%; margin: 2.5%; padding: 0;}
1 Answer
Jacob Bender
15,300 PointsIn chrome, I have found the developer tools to be super handy for figuring out problems like this. You may know how to troubleshoot this way already, but if not:
Open your .html file in chrome Right click->inspect element Open up the elements if collapsed in the view until you see what you need (alternatively highlight your footer before inspecting) When you highlight an element, the CSS should show on the right, as well as highlighted in the browser. You can make changes here and fiddle with the css without hurting your .html or .css (refresh and it'll go back).
Hope this helps.
brandonlind2
7,823 Pointsbrandonlind2
7,823 PointsThanks man that really helps