0

I have been working on a little project and I have run into a problem. When I view my website in a browser there is a very large open space at the bottom of all of the content. Can anyone help me locate what the problem is? I have been trying to find it for hours.

Here's the code:

<html>
<head>
<title>Media Mash - Home</title>
<style type="text/css">
* {
font-family:neuropol;
color:rgb(255,255,255);
}
body {
background-color:rgb(52,126,153);
}
.text1 {
font-size:20;
color:rgb(0,0,0);
}
.text2 {
font-size:35;
text-decoration:none;
margin-left:4%;
margin-right:4%;
}
.parent {
min-width:1255px;
}
.topBar {
background-color:rgb(161,35,35);
display:inline-block;
width:1247px;
text-align:center;
height:40px;
}
.leftBar {
top:8px;
background-color:rgb(161,35,35);
position:relative;
display:inline-block;
width:250px;
text-align:center;
height:581px
}
.main {
background-color:rgb(161,35,35);
position:relative;
display:inline-block;
left:258px;
bottom:573px;
width:989px;
height:581px;
}
.imageLeft {
background-color:rgb(104,22,22);
position:relative;
display:inline-block;
}
.imageRight {
background-color:rgb(104,22,22);
position:relative;
display:inline-block;
}
.textLeft {
background-color:rgb(104,22,22);
position:relative;
display:inline-block;
}
.textRight {
background-color:rgb(104,22,22);
position:relative;
display:inline-block;
}
.copyright {
background-color:rgb(161,35,35);
position:relative;
display:inline-block;
height:32px;
bottom:565px;
width:1247px;
text-align:center;
}
</style>
</head>
<body>
<div class="parent">
    <div class="topBar">
        <a class="text2" href="placeholder.html">Media Mash</a>
        <a class="text2" href="placeholder.html">Film</a>
        <a class="text2" href="placeholder.html">Music</a>
        <a class="text2" href="placeholder.html">Games</a>
        <a class="text2" href="placeholder.html">Books</a>
    </div>
    <br/>
    <div class="leftBar">
        <a class="text1">
            Media Mash is a website dedicated to helping you realise what favourite films, songs, games and books are.
            <br/>
            <br/>
            We do so in a fun image versus image format, which allows you to pick out your favourites.
            <br/>
            <br/>
            Have a go and create your top 10 lists today!
        </a>
    </div>
    <br/>
    <div class="main">
        <div class="imageLeft">
            <img src="images\The Avengers MM.jpg"/>
        </div>
        <div class="imageRight">
            <img src="images\Star Wars V The Empire Strikes Back MM.jpg"/>
        </div>
        <br/>
        <div class="textLeft">
            <a class="text1">The Avengers</a>
        </div>
        <div class="textRight">
            <a class="text1">Star Wars V: The Empire Strikes Back</a>
        </div>
    </div>
    <br/>
    <div class="copyright">
        <a class="text1">Copyrighted intellectual property of Thomas Crowther ©</a>
    </div>
</div>
</body>
</html>
sg3s
  • 9,411
  • 3
  • 36
  • 52
  • There is NO problem. How can you expect not to have fixed heights is you manually defined the heights in your CSS ?? – Roko C. Buljan May 20 '12 at 21:29
  • i would suggest to not use "fixed" height, and postioning. You would rather use display and float. You should also try not to make your pages above 1000px, rather use a wrapper of 1000px and center it with margin:0 auto; And as Blowski said install firebug, or web developer plugin for firefox, otherwise Opera/Safari/GoogleChrome has integrated tools in it ... – HamZa May 20 '12 at 21:38

1 Answers1

2

As your code stands, the browser is first rendering the page with the boxes underneath each other, and then moving the box to appear to the right of the other one. That's what relative positioning means.

What you want to do is, instead of using relative positioning, use float:left (on .leftBar) and float:right (on `.rightBar). The browser will render the elements in place to begin with.

I would suggest that you read about the 'box model' in CSS, and check out Firebug for Firefox.

Dan Blows
  • 20,846
  • 10
  • 65
  • 96