CanadianN1nj4
Posts: 1
Joined: Tue May 20, 2014 9:22 pm

CSS not working on coder

Tue May 20, 2014 9:30 pm

No pictures are showing up even if the li's are the same as the css ones, only the HTML is showing

I have this as my HTML:
<!DOCTYPE html>
<html>
<head>
<link href="http://s3.amazonaws.com/codecademy-cont ... /shift.css" rel="stylesheet">
<link rel="stylesheet" href="main.css">
</head>

<body>
<div class="nav">
<div class="container">
<ul>
<li><a href="#">Duck logo</a></li>
<li><a href="#">Podcasts</a></li>
<li><a href="#">Reviews</a></li>
</ul>
<ul>
<li><a href="#">Gaming News</a></li>
<li><a href="#">Tech News</a></li>
<li><a href="#">Contact</a></li>
</ul>
</div>
</div>

<div class="jumbotron">
<div class="container">
<h1>Podcasting the World over</h1>
<p>For Video podcasts visit our youtube channel</p>
</div>
</div>

<div class="learn-more">
<div>
<div>
<div>
<h3>Travel</h3>
<p>From apartments and rooms to treehouses and boats: stay in unique spaces in 192 countries.</p>
<p><a href="#">See how to travel on Airbnb</a></p>
</div>
<div>
<h3>Host</h3>
<p>Renting out your unused space could pay your bills or fund your next vacation.</p>
<p><a href="#">Learn more about hosting</a></p>
</div>
<div>
<h3>Trust and Safety</h3>
<p>From Verified ID to our worldwide customer support team, we've got your back.</p>
<p><a href="#">Learn about trust at Airbnb</a></p>
</div>
</div>
</div>
</div>
</body>
</html>




AND THIS AS MY CSS:

.nav a {
color: #5a5a5a;
font-size: 11px;
font-weight: bold;
padding: 14px 10px;
text-transform: uppercase;
}

.nav li {
display: inline;
}

.jumbotron {
background-image:url('http://ofbuckleyandbeatles.files.wordpr ... attern.gif');
height: 5000px;
}

.jumbotron .container {
position: relative;
top:100px;
}

.jumbotron h1 {
color: #fff;
font-size: 48px;
font-family: 'Shift', sans-serif;
font-weight: bold;
}

.jumbotron p {
font-size: 20px;
color: #fff;
}

.learn-more {
background-color: #f7f7f7;
}

.learn-more h3 {
font-family: 'Shift', sans-serif;
font-size: 18px;
font-weight: bold;
}

.learn-more a {
color: #00b0ff;
}

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: CSS not working on coder

Wed May 21, 2014 12:31 am

Learn how to use a browser console; it will tell you what's wrong, like your css is likely 404.

Putting the CSS in the HTML instead of linking to it seems to work:

Code: Select all

<!DOCTYPE html>
<html>
<head>
	<style>
		@font-face {
			font-family:'Shift';
			font-style:normal;
			font-weight:normal;
			src:url("http://s3.amazonaws.com/codecademy-content/courses/ltp/fonts/shift.woff") format("woff");
		}
		@font-face {
			font-family:'Shift';
			font-style:normal;
			font-weight:bold;
			src:url("http://s3.amazonaws.com/codecademy-content/courses/ltp/fonts/shift-bold.woff") format("woff");
		}
		.nav a {
			color:#5a5a5a;
			font-size:11px;
			font-weight:bold;
			padding:14px 10px;
			text-transform:uppercase;
		}
		.nav li {
			display:inline;
		}
		.jumbotron {
			background-image:url('http://ofbuckleyandbeatles.files.wordpress.com/2011/01/testpattern.gif');
			height:5000px;
		}
		.jumbotron .container {
			position:relative;
			top:100px;
		}
		.jumbotron h1 {
			color:#fff;
			font-size:48px;
			font-family:'Shift',sans-serif;
			font-weight:bold;
		}
		.jumbotron p {
			font-size:20px;
			color:#fff;
		}
		.learn-more {
			background-color:#f7f7f7;
		}
		.learn-more h3 {
			font-family:'Shift',sans-serif;
			font-size:18px;
			font-weight:bold;
		}
		.learn-more a {
			color: #00b0ff;
		}
	</style>
</head>
<body>
	<div class="nav">
		<div class="container">
			<ul>
				<li>
				<a href="#">
					Duck logo
				</a>
				</li>
				<li>
				<a href="#">
					Podcasts
				</a>
				</li>
				<li>
				<a href="#">
					Reviews
				</a>
				</li>
			</ul>
			<ul>
				<li>
				<a href="#">
					Gaming News
				</a>
				</li>
				<li>
				<a href="#">
					Tech News
				</a>
				</li>
				<li>
				<a href="#">
					Contact
				</a>
				</li>
			</ul>
		</div>
	</div>
	<div class="jumbotron">
		<div class="container">
			<h1>Podcasting the World over</h1>
			<p>
				For Video podcasts visit our youtube channel
			</p>
		</div>
	</div>
	<div class="learn-more">
		<div>
			<div>
				<div>
					<h3>Travel</h3>
					<p>
						From apartments and rooms to treehouses and boats: stay in unique spaces in 192 countries.
					</p>
					<p>
						<a href="#">
							See how to travel on Airbnb
						</a>
					</p>
				</div>
				<div>
					<h3>Host</h3>
					<p>
						Renting out your unused space could pay your bills or fund your next vacation.
					</p>
					<p>
						<a href="#">
							Learn more about hosting
						</a>
					</p>
				</div>
				<div>
					<h3>Trust and Safety</h3>
					<p>
						From Verified ID to our worldwide customer support team, we've got your back.
					</p>
					<p>
						<a href="#">
							Learn about trust at Airbnb
						</a>
					</p>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

SB2020
Posts: 10
Joined: Thu Sep 06, 2012 1:34 pm

Re: CSS not working on coder

Wed May 21, 2014 9:39 am

As you have it there, "main.css" should be located in the same folder as your html.

Return to “General programming discussion”