Trying to bottom align a hover over tooltip span window

    I am using a simple hover over tooltip, which works very well, the trouble I have is, if the hover over is near the bottom of the page, it often drags the hover window off the bottom.....  What I want to do is align the bottom of the hover window to the bottom of the div, resulting in it always showing.  This is the CSS code to make the hover over tooltip appear:

<style type="text/css">

		.tooltip {
			border-bottom: 1px dotted #000000; color: #000000; outline: none;
			cursor: help; text-decoration: none;
			position: relative;

		.tooltip span {
			margin-left: -999em;
			position: absolute;
		.tooltip:hover span {
			border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; 
			box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
			font-family: Arial, Tahoma, Geneva, sans-serif;
			display:inline; position:absolute; color:#fff;
			vertical-align: bottom; margin-left: -20px; width: 400px;

		.tooltip:hover em {
			font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
			display: block; padding: 0.2em 0 0.6em 0;

		p {
    margin-top: 0;

		.custom { padding: 0.5em 0.8em 0.8em 2em; }

		* html a:hover { background: transparent; }

		.help { background: #000; border: 2px solid #FFF;	}

		.info { background: #000; border: 2px solid #FFF;	}



Open in new window

I have attached a file to show how it currently looks.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In tooltip span or tooltip or tool tiphover try something like: bottom:-100px;  see what happens.  One of those three css entries will control the position of the tooltip. the bottom -100px will show a dramatic change in the positon.  From that, you can adjust the bottom: to suit your needs.

It would help if there was a url.
damianb123Author Commented:
     It appears to be the .tooltip hover span which controls the position, and you are correct that adding a margin bottom does adjust the box, however there are approx 50 hover overs all pulled from the database, each with varying info within, so the size of the hover box changes greatly.  I added this, vertical-align: bottom; but it made no difference.... Its on the last line of the tooltip hover span block.

Take a look here, you will see what i mean:

Do you mean how it goes off the right side of the page?  If so, get rid of the margin-left: -999em;
and start over with left:100px; and see what happens.

If that is not what you mean, please explain further.
Wait, I was wrong:
Start adjusting here:

.tooltip span {
    margin-top: -175px;
    position: relative;
    right: 100px;

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.