I have a page with a footer on it that is defined as such in the html:
<div id='footer'>
<span style="float:left;">
Contact me at <a href='mailto:admin@test.com'>admin@test.com</a>
</span>
<span style="float: right;">test</span>
</div>
And the CSS for the footer div is as such:
#footer {
position: fixed;
bottom: 0px;
left: 0;
z-index: 998;
width: 100%;
background-color: #000000;
padding: 2px 0 3px 20px;
border-top: 3px groove #aaaaaa;
font: 11pt Arial;
}
What I have discovered through some Google searching is that padding a div will add that padding to the size. In my case, padding 20px to the left is adding 20px to the width, so the new width of the div is 100% + 20px and those extra 20px are off the right edge of the viewport.
I found a lot of people saying to use margins rather than padding, so I tried it with margin-left: 20px instead of the padding, but the "test" text was still off the screen to the right.
How can I simulate the look of the padding but without the right floated text off the screen?