Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Anchor and image inside of div Reply To: [Solved] Anchor and image inside of div

#204587
Paulie_D
Member

As for tidying that’s really a matter of choice.

Firstly, many consider it good practice not to use IDs quite so liberally.

They are fine if you know you won’t be re-using the ID again on the same page (say your but more often than not you will find it more flexible to use a class instead.

Case in point…your #wrap ID…if you wanted to have another wrap you’d need another ID, make it a class and it’s re-usable.

On the positioning side, where you are trying to position many things over an element, it makes sense to wrap those items up into a single container and position that.

Below I added a single .detail div and centered that which means I could eliminate the positioning from the link and div inside it. Also, my version will always center over the image regardless of the size of the image.

http://codepen.io/Paulie-D/pen/mJxyjM?editors=110

For a couple of days you’ve done great…there’s a ton more to learn but it seems to me you’re on the right track.

Keep building, trying things out, seeing what works and doesn’t…and if it doesn’t we’re here to help.