Div is hidden but still taking up space-how to get rid of it

I have a div that is hidden but it is still taking up the space on the page(there is a big gap before the h1 tag):
<div id=“head” style=“display:none;padding:0px;”>
How can I change this?

That’s not the div that’s causing the space above the h1.

It is the height on your .step1_content div - (line 8 in your internal css)

.step1_content { padding:0px; width:463px; height:220px; }
Remove that height and let the content determine the height.

The 340px height on the .step1_main div is also playing a role in this (line 5)

You need to validate your page, you have a <style> tag inside your body element. (line 47-49)
All <style> tags other than inline styles should be in the <head> element or linked to via an external stylesheet in the head.

Not sure what the purpose of nesting everything in the table is, I see no reason for it though.

Thank you for the reply, I understand the concept of using the content to define the height instead of fixed heights. I made those changes and it works fine- there is an issue when I move the style from 47-49 (the green background doesn’t show). Why is that please?


The errors in the embedded styles in the <head> may be contributing. Replace them with the following and remove the <style> from <body>.

Fixes indicated by comments marked FIXED.

#set1, #set2, #set3, #set4, #foot {
	text-align: left;
	padding-left: 20px;
	padding-top: 0px;
	background-color: green;
.step1_main table {
	float: left
.step1_main {
	position: relative;
	width: 100%;
	overflow: hidden; /*height:340px;*/ width:482px;
	text-align: center;
	background-image: url('./show_files/bg1.png');
	background-repeat: no-repeat;
.step1_content {
	padding: 0px;
	width: 463px; /*height:220px;*/
.step1_submit {
	float: right;
	position: absolute;
	bottom: 15px;
	right: 22px;
	background-color: orange;
	padding-bottom: 4px;
	padding: 0 0 4px;
	margin-top: 0px;
	margin-right: 12px;
	width: 120px;
	height: 30px;
	color: #ffffff; /* FIXED semi-colon added */
	font-family: verdana;
	font-size: 14pt;
	font-weight: bold;
	-webkit-border-radius: 7px;
	-moz-border-radius: 7px;
	border-radius: 7px; /* FIXED semi-colon added and closing bracket removed */

Perfect thanks Victorinox and Ray works great!