Click here to Skip to main content
15,896,502 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm in the tech degree program for Team Treehouse. I'm doing their projects. On my current project, the body is hiding my HTML elements. I don't want them to be hidden. Please help me figure out what I'm doing wrong.

This is the HTML:

the img tag under "Newsletter" is where it starts to break.

HTML
<!DOCTYPE html>
	<html lang="en">
		<head>
			<link rel="stylesheet" type="text/css" href="survey_styles.css">
			<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600" rel="stylesheet" type="text/css">
			<meta name="viewport" content="width=device-width, initial-scale=1">
		</head>
		
		<body>
		<div class="nav">
				<ul>
					<li class="frog"><a href="index.html">Accessible Frog</a></li>
					<li><a href="tour.html">Tour</a></li>
					<li><a href="">Survey</a></li>
				</ul>
			</div>
		<div class="header">
			<div class="heading">
				<h1>ACCESSIBLE FROG</h1>
				<h2>we make awesome music</h2>
			</div>
		</div>
		<div class="box">
			<h1>Survey</h1>
			<img src="img/concert01.jpg" width="200">

			<p>Who is your favorite band member?</p>
				<form>
					<div class="optab">
						<input type="radio" name="band" value="John"> John
						<input type="radio" name="band" value="Bob"> Bob<br>
					</div>
					<input type="radio" name="band" value="Hazzard"> Hazzard
					<input type="radio" name="band" value="Sally"> Sally
				</form>	
			<p>What is your favorite album?</p>
				<select>
					<option>Party For An Angel</option>
					<option>A Day of Old</option>
					<option>Finding my Shadow</option>
					<option>Diamond Fireworks</option>
					<option>Enjoy Your Desire</option>
					<option>This Is For You</option>
					<option>Music Of My Life</option>
					<option>Song For Yesterday</option>
					<option>Heroic Forever</option>
					<option>Midnight Fires</option>
					<option>Street of the Rider</option>
				</select>
			<p>What is your favorite song?</p>
				<textarea rows="5" col="20"></textarea>
		<div class="box2">
			<h1>Newsletter</h1>
			<img src="img/the_band.jpg" width="200">
			
		</div>


			
		</div>



This is the CSS:

CSS
@media (max-width: 500px) {
body {
color: green;
height: 1000px;
}

.header {
background: url("img/concert02_no_text.jpg") no-repeat center center;
background-size: cover;
height: 300px;
margin-top: -101px;
margin-left: -7px;
margin-right: -10px;
overflow: hidden;
text-align: center;

}

ul {
list-style: none;
text-align: right;
background-color: rgba(0, 0, 0, 0.6);
width: 100%;
position: fixed;
top: 0px;
left: 0px;
margin-top: 0px;
height: 50px;

}

ul li {
display: inline-block;
position: relative;
margin-top: 15px;
right: 40px;	
color: #9b9b9b;
margin-right: 20px;
font-size: .75em;
}	

a {
text-decoration: none;
color: grey;

}

ul .frog {
text-align: left;
position: fixed;
left: 5%;
letter-spacing: 2px;
font-size: .75em;
}

.heading h1 {
color: black;

}

h1 {
position: relative;
top: 125px;
font-size: 1.5em;
margin-top: 30px

}

h2 {
position: relative;
top: 100px;
font-size: 1em;
color: #ad0505;
margin-top: 30px;

}

.box {
background-color: black;
background-size: cover;
height: 600px;
margin-top: -15px;
margin-left: -7px;
margin-right: -10px;
padding-bottom: -200px;
overflow: hidden;
text-align: center;
}

.box h1 {
color: red;
position: relative;
top: -10px;

}

.input p {
color: green;

}

.optab {
position: relative;
right: 15px;

}

.box2 {
background-color: black;
background-size: cover;
height: 500px;
margin-top: -15px;
margin-left: -7px;
margin-right: -10px;
padding-bottom: -200px;
text-align: center;
}

.box2 h1 {
padding-top: 20px;

}

}


What I have tried:

Adjusting padding, margins, removing hidden from overflow or increasing body height.
Posted
Updated 22-Nov-16 21:15pm
v3
Comments
Cristina Carrasco Angulo 22-Nov-16 18:54pm    
I tried your code here:
https://jsfiddle.net/7vg93upw/
code

looks like it works.... :-S

1 solution

You have two problems:

1. You fixed the ul element to the top instead the container (nav)
Change you CSS like this:
CSS
/* new */
.nav
{
    width: 100%;
    position: fixed;
    top: 0px;
    left: 0px;
    z-index: 9999;
}

/* updated */
ul
{
    list-style: none;
    text-align: right;
    background-color: rgba(0, 0, 0, 0.6);
    margin-top: 0px;
    height: 50px;
}


2. You are creating grey for the navigation bar by defining half-opaque black... it means you will see thru that nav-bar evn thing blow it...
Change rgba(0, 0, 0, 0.6) to rgb(103, 103, 103)
 
Share this answer
 
v2

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