Forums

Why is this table not aligning my content?

As you can see, I have a live twitter feed and two icons all contained into a table so they will align (its the only way I’ve been able to do this). Why does the table add an extra 13px to the feed? There is no margin style on any of the CSS or cell padding. Thoughts?

The reason there’s an extra 13 pixels at the top is that the images are aligned to the font baseline by default which pushes them up a little. You could set them to vertical align: bottom; or display: block; – either will work. But I’d try to redo it without the table. You should be able to float them without any trouble (and jnh will suggest inline-block ;)

and float the ul and img left with a width of 900 on the ul
edit// you don’t really need to wrap everything in a div to float. and I see that you added a third image. The triangle really should be a background image (its not content) perhaps on the ul and the inline styling isn’t good practice – move it to the stylesheet

Tips

Categories

We have a pretty good* newsletter.

Email Address

CSS-Tricks* is created, written by, and maintained by Chris Coyier and a team of swell people. It is built on WordPress, hosted by Media Temple, and the assets are served by MaxCDN. The fonts are Source Sans Pro and Source Code Pro. It is made possible through sponsorships from products and services we like.