Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<!doctype html>

<html>

<head>

<title> Secret Of Beauty </title>
<meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/main.css"/>

</head>

<body>


<header>
<h1> Secret of Beauty</h1>
</header>

<nav>



    <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
        <li><a href="#">Product</a></li>
        <li><a href="#">Locations</a></li>
    </ul>

    </nav>

        </body>

        </html>


(Index code saved within a HTML folder that contains a css folder which also contains main.css)

CSS
body {
    text-align: center;
}

header {
    height:100px;
    background:black;
    width:100px;
}



CSS CODE which only works when I alter the body {} sections but when ever I attempt to mess with the header it does nothing I put multiple colors within the body{} code which all worked and filled out the page but nothing is working with the header files
Posted

1 solution

HTML
<style type="text/css">
       body {
       text-align: center;
       }

       header {
       height:100px;
       background:black;
       width:100%;
       }
       header h1{
       color:#FFF;
       }
   </style>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900