user3312820
user3312820

Reputation: 3

Ignoring styles while using <p>

I am using following

http://codepen.io/anon/pen/abpEB 

you can see a simple html+css code. And I can't understand why text is not colored in red :( Strange fact that when I'm using <div> instead <p> — color is red.

Does anybody know what's wrong here?

Upvotes: 0

Views: 125

Answers (2)

Arjun
Arjun

Reputation: 1439

this is because of you are using <p> tag inside of another <p> tag, html render them as two separate <p> tag, you can see this by inspecting element in chrome. you can use span tag inside <p> tag.

Upvotes: 1

Krish
Krish

Reputation: 1894

please remove the first css class and use this code

p.street {
 color: red;    
}

Upvotes: 0

Related Questions