Jakob991 Jakob991 - 6 months ago 8
HTML Question

CSS defining a class

I tried (HTML Page)

<div class="cities">
<h6>London</h6>
<p>
London is the capital city of England. It is the most populous city in the United Kingdom, with a metropolitan area of over 13 million inhabitants.
</p>
</div>


CSS Page

p.cities {
background-color:black;
color:white;
margin:20px;
padding:20px;


}

Could I get help defining a class in CSS? I have seem to run into a mental wall. I cant wrap my head around this concept.

Answer

You have p.cities. You want div.cities

Your element is a <div>, not a <p>