Index

Newbie Spellweaver
Joined
Jan 25, 2014
Messages
19
Reaction score
2
Hello RaGEZONE,

I, myself, am coding a new index for a hotel I am planning on creating but I have ran into a problem.

The problem is to do with the coding side of things and its only CSS, so pretty basic; but for some reason every time I try to add a "margin-top" to a div class inside another div class the div that it is in also moves down! Why is this and whats the solution?

ijosOxG - Index - RaGEZONE Forums


Its suppose to be so that the purple is at the top with the white bar going across and the white box inside of the purple background is suppose to be 30% from the top of that div.

Code:
HTML:

<div class="main">


			<div class="register_content">






			</div>


		</div>

Code:
CSS:

.main {


	background-image: url(../img/bg/main_purple.gif);
	background-repeat: repeat-x;


	width: 100%;
	height: 83%;


	position: relative;


}


.register_content {


	border-radius: 4px;


	background-color: #ffffff;


	box-shadow: 0 0 0 1px #a6a6a6 inset,0 0 0 3px #f2f2f2 inset;


	width: 400px;
	height: 400px;


	margin-top: 30%;
	margin-left: 35%;


	position: relative;


}

and as always, thanks for reading!.

CodeTrinity!
 
Back