The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Why won’t my code
I’m trying to make a page which has two images, which link to certain areas of a website. On hover, they change to a coloured version of the same image, which is done via the :hover function in CSS.
This all works fine, but I need the images to be centered, but nothing I’ve tried is working. Can someone help me?
This should get you in the right direction: http://codepen.io/senff/pen/iGylw
I would recommend margin: 0 auto; for center aligning elements. http://codepen.io/JTParrett/pen/DtveJ