user892134
user892134

Reputation: 3224

Head Tags have broken page

Ever since i added head tags to my webpage the CSS has broken(divs are misplaced, id's and classes are being applied). Below is an example, any idea why the CSS would be broken? When i was using span tags the CSS worked but since using head tags the CSS for the whole page has broken.

 <head><style type="text/css">   
     h1{
    color:#000000; font-size:28px; font-family:Arial;
    }
    </style></head>


<body>
 <p><h1>$title</h1></p>
</body>

Upvotes: 0

Views: 85

Answers (2)

Aboodred1
Aboodred1

Reputation: 1503

Try to add html tag at the very top and replace single quotes with double quotes

<html xmlns="http://www.w3.org/1999/xhtml"></html>

Upvotes: 0

Mr Lister
Mr Lister

Reputation: 46559

You can't put <h1> elements in <p> elements, so if you had <span>s there first, it would have worked better. Take the <h1> out of the <p>.

Upvotes: 1

Related Questions