Jump to content

<div align> or something. help. simple and easy but im lost lol


Minimeallolla

Recommended Posts

say if I had a black page with a background or something simple and it had no content except for a link called "about us"

and I wanted that link to be located at the bottom left side of the page but since it has no content its stuck up the top unless <br> or <p> is introduced.

how could this be done without spamming <br /><p><br /> untill im happy with its location and if content is added it gets boosted down further with a massive gap ><

Try This

 

Play around with the margin-top: -7.5em;

 

Credit goes to Cameron Adams

http://www.last-child.com/forcing-the-footer-to-always-be-at-the-bottom-of-a-page/

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
html { height: 100%;}
body {
height: 100%;
background-color: #000000;
margin: 0px;
padding: 0px;
}
#content { position: relative; min-height: 100%;}
* html #content { height: 100%;}
#bnav {
position: relative;
margin-top: -7.5em;
color: #FFFFFF;
}
-->
</style>
</head>

<body>
<div id="content"></div>
<div id="bnav">About Us </div>
</body>
</html>

if this link is in a ul or ol, which it should be.....you could easily create a style rule on the ul/ol like so:

 

ul {margin-top: 600px;}

 

You cna play around with the pixels, even use percentages.

Cool thanks for the tip, after playing with this, I have found this a very useful techique for future projects

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.