Jump to content

Need help with a slight Css&HTML

RockiLocky
Go to solution Solved by leodaniel,

You have a typo: 

<div clas="Widget"></div>
<!-- clas !== class -->
<div class="Widget"></div>

 

So I have started to learn CSS and HTML and wanted to test stuff out with classes and came up with this problem:

 

<!DOCTYPE html>
<html>
	<head>
		<title>Nachbau eines Bootstrap Formates</title>
		<link rel="stylesheet" type="text/css" href="styles/main.css">
	</head>
	
	<body>
		<div clas="Widget">
			<div class="header">my Header</div>
			<div class="body">
				<p>my Body</p>
			</div>
		</div>
	</body>
</html>

 

.Widget{
	margin: 3%;
	font-style: arial;
}

.Widget .header{
	background: black;
	color: white;
}

 

image.png.c966647fcfdf32864944f7d6ec050ae4.png

 

And I am confused because my header does not get the black background. I looked around the internet for a hour and didnt find a solution, because you are supposed to acces a sub class as such.

 

Hope somebody can help me out.

 

 

With regards,

Rocki

Link to comment
Share on other sites

Link to post
Share on other sites

You have a typo: 

<div clas="Widget"></div>
<!-- clas !== class -->
<div class="Widget"></div>

 

Business Management Student @ University St. Gallen (Switzerland)

HomeServer: i7 4930k - GTX 1070ti - ASUS Rampage IV Gene - 32Gb Ram

Laptop: MacBook Pro Retina 15" 2018

Operating Systems (Virtualised using VMware): Windows Pro 10, Cent OS 7

Occupation: Software Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, leodaniel said:

You have a typo: 


<div clas="Widget"></div>
<!-- clas !== class -->
<div class="Widget"></div>

 

mate I suck it seems like ;D

 

But thanks a lot you saved me ;D

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×