Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
The top have shows the parallax background and the bottom half will contain my main content. I am trying to align my logo on the top left side and display the word "hello" at the center of the parallax background (of the top half). Please help!


Here's my HTML:

HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>mima's Portfolio Site</title>
<link href="portfolio.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'>

<script type="text/javascript">
	var ypos,image;
	function parallax () {
		ypos = window.pageYOffset;
		image = document.getElementById('image');
		image.style.top = ypos * .4 +'px';
	}
	window.addEventListener('scroll',parallax)
</script>
</head>

<body>
<img id="image" src="portfolio_images/working.jpg" height="100%" width="100%" />
<img class="logo" src="portfolio_images/mima_logo.png" width="400" height="400" alt=""/>
<div class="intro"> Hello </div>

<div id="content"> </div>
</body>
</html>



AND HERE'S MY CSS:

CSS
@charset "utf-8";
/* CSS Document */

*{
	margin: 0px;
	padding: 0px;
}
#image {
	position: relative;
	z-index: -1;
	}
#content {
	height: 750px;
	width: 100%;
	margin-top: -10px;
	background-color: #FFFFFF;
	position: relative;	
	z-index: 1;
	}
.intro {
	font-family: 'Pacifico', cursive;
	font-size: 150px;
	color: #fff;
	text-align: center;
	padding-top: 10px;
	}
.logo {
	margin: 10 0 0 0;
	float: left;
	opacity: 0.4;
    filter: alpha(opacity=40); /* For IE8 and earlier */
}
Posted
Comments
Sinisa Hajnal 11-Jan-16 2:49am    
Did you try position fixed so it simply hovers there?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900