Im making a simple webpage for a course which shows the diversity of css and the styles it can bring. Ive managed to google my way a few properties to give my style some form but I am exhausted myself on two problems.
1. I need to center the entire contents of a holder/wrapper <div> to the dead centre of a page regardless of screen resolution etc.
So far I have managed to centre it only at the top of the page, this was done with
#main{ margin-left:auto;
margin-right:auto;
width:50em; }
Im asking if someone could clarify on expanding this for me.
2. My second problem is most likely even simpler. I want to centre the contents (in this case a line of text and a small picture) in the centre of a <div>.
Again in this case I can only do it horizontally with
text-align: center;
but vertically it still appears at the bottom because the picture is right beside the text.