Hey guys for some reason I am struggling with this. I have a footer and I’m adding in a marketing banner. For example, see home page:
On the footer I’d like to add a 2nd 120x60 ad button to the left of the current one that is there. This theme is coded in wordpress and teh footer is a widget. Right now, it’s just a footer…
I have a second image same size and I want it directly to the left of the current one. For the life of me I can’t get it right. It either falls underneath or overlaps.
Hey @Parafly9;
We’ve built a new product at SitePoint to help people fix broken CSS in real-time. Your issue looks like one that we could easily help you fix immediately.
One of our CSS experts is online now and ready to help if you’re interested in giving it a go.
Edit: I’m removing the link to the product while we fine tune and develop further. Will keep you posted.
Further to my last post, I actually went ahead and used your post as a test case for the product.
You can see how it went down and get your solution here http://codefix.sitepoint.com/requests/19/edit
(note this is currently a testing product only so doesn’t look flash in IE)
Try it using the Div attribute and hopefull it will be helpful in making things better.
<div class=“footer-icons”>
<div id=“footer-twitter”>
<img src=“images/twitter.png” width=“40” alt=“”>
</div>
<div id=“footer-fb”>
<div class=“fb-like” data-href=“http://facebook.com/user” data-send=“false” data-layout=“button_count” data-width=“160” data-show-faces=“false” data-font=“arial”></div>
</div>
</div>
OK you know, I don’t really have enough room where I want to put it anyway because of th eimage in the way. Trying to put it in the very bottom of the footer instead. See here:
Except now the image sits all the way at the bottom. Tried putting in a new class to vertical-align:middle but it didn’t work
bizarre. I have no idea what I’m doing, just trial and error. I got rid of any <P> or <div> tags around the images and now they line up nicely at the bottom. OK.
Hi, That’s because <a> and <img> are inline elements by default. However it is not good practice to have an inline element running into a block element, some browsers will give undesired results with that.
I would wrap the anchors (which the img is nested in) with a <p> as you had it. The problem was the width you had on your #footer p, remove that width and let the floats shrinkwrap, then set a right margin on the p.
As it is now, those anchors/images are sliding under the p.copy float.
If you need more control on the left <p> which contains the text, then utilize that .copy class that is already on it.
As it is now, those anchors/images are sliding under the p.copy float.
Sorry, that was not correct. Inline elements do not slide under floats, only blocks do.
I was seeing the img butt up to the text when I removed the width.
Another way to fix this is to move your width:280px; from #footer p top.copy
That way your <p> tags with the anchor/img will not be picking up the widths and causing them to drop.