I am newbie, help me i dont know where my mistake in css is

Hi i typed some css code but i cant find how make color change of the (#division3)?

<!doctype html>
<html> 
<head> 

<meta charset="utf"/>
<title></title>
<style>

.wrap {

background: lightblue;
color: red;
}
.wrap h1 {
	color: grey;}
}
#division2 p { 
 	color: green;
 }
</style>
</head>

<body>

<div class="wrap">
	<header>
		<h1>My website</h1>
		<div id="division2">
			<p>I cant change color of this text</p>
		</div> <!-- i cant change color of this div text. -->
		
		<nav>
			<ul>
				<li><a href="#">1</a></li>
				
			</ul>
		</nav>
	</header>
</div>

</body>
</html>

Hi, you have an extra closing bracket here.

.wrap h1 {
	color: grey;}
}
#division2 p { 
 	color: green;
 }

The first step to debugging should be validating your page and code.

http://validator.w3.org - HTML
http://jigsaw.w3.org/css-validator - CSS

Thank you 1000 times , I love you :blush:

I’m afraid I do not reciprocate, but you’re welcome :slight_smile: .

Please one more question. What is difference between these two expressions.

.loud span#angry em

and

.loud span #angry em

Both #angry are descendant of span , i mean , are inside of span

In the first example, you are selecting an <em> that is a child of <span id="angry"> (note that the span MUST have this ID because you have span#angry) and THAT span is a child of an element with class=“loud”. Example below:

<div class="loud">
  <span id="angry">
    <em>Text</em>
  </span>
</div>

Note that this above example will not work for the 2nd CSS rule you have.

The second example is selecting an em that is a child of ANY ELEMENT that has the id=“angry”. This can be a span, OR IT CAN BE ANYTHING like a DIV or a TABLE or UL tag. Any sort of tag. Now, this id=“angry” element is a child of a <span> element, which is a child of a class=“loud” element. Example below:

<div class="loud">
  <span>
    <b id="angry">
      <em>text</em>
    </b>
  </span>
</div>

With that space between span and #angry, that means that the HTML element has an id=“angry”. Without it, “span #angry” is talking about two different elements.

I found that example in some tutorials, since it is audio and i am not english native speaker i couldnt figure out what it is for weeks :). Now it is all clear , thnxxxxxx , I am so happy now .

Are you a turbine?

1 Like

Are you coming onto me?

Off Topic:

I do not get your joke :frowning: . I’m not clever

My off-beat sense of humor playing word association…

two types of engines:

reciprocating

  • primary feature: cylinders commonly on a crankshaft
  • found in most automobiles

turbine

  • primary feature: hot gas rotates a fan
  • jet engines

"if you don’t reciprocate, maybe you spin really fast! (or whatever)

You’re busy being well grounded, smart.

I get it now! Don’t worry. I’ve had a few members/staff make jokes that I do not understand.

Either they aren’t funny or I’m terrible at recognizing good jokes when I see them :wink: .

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.