Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Christopher Ponce
Christopher Ponce
2,766 Points

my nav its disabled

im gonna post the code i think its a float property but i kind of need it

Christopher Ponce
Christopher Ponce
2,766 Points
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
  <title>introduction</title>
 <link rel="stylesheet" href="CSS/normalize.css">
  <link rel="stylesheet" href="css/main.css">
</head>

<body>
  <div id="header">
<header>
    <h1 class="pos_left">C# Tutorial</h1>
</header>
    </div>

<section>
  <div id="menu" class="pos_top">

<nav>
  <p class="pos_left">Navegacion</p>
  <ul>
    <li><a href="variables.html">Variables</a></li>
    <li><a href="controlstructures.html">Control Structures</a></li>
    <li><a href="loops.html">Loops </a></li>
  </ul>

</nav>
    </div> 

  <div id="content" class="pos_left">
    <h3>Introduccion</h3>
   <p>Bienvenidos al tutorial de C#. En este tutorial aprenderan a como se declaran variables, las estructuras de controles y<br> tambien conoseran los loops. Pero primero deberan aprender y entender lo que es C#.</p>
    <p><br>¿Que es C#?<br>C# es un lenguaje de programación que se ha diseñado para compilar diversas aplicaciones que se ejecutan en .NET Framework. C# es simple, eficaz, con seguridad de tipos y orientado a objetos. <br>Las numerosas innovaciones de C# permiten desarrollar aplicaciones rápidamente y mantener la expresividad y elegancia de los lenguajes de estilo de C.</p>
    </div>

</section>  

 <div id="footer">
  <footer class="pos_top">
    <h2>&copy;2014 Christopher Ponce</h2>
  </footer>
 </div>


</body>
</html>
Christopher Ponce
Christopher Ponce
2,766 Points
h1 {
  margin: 0;
  text-align: center; 
}
body{
  margin: 0 100px 0 0;
  background-color:black;
}
p{
  margin: 0;
  color: blue;
}
header{
  margin: 0 5px 0 0;
  background-color: darkgreen;
}

#menu{
  height:600px;
  float: left;
  background-color: cyan;
}
#menu.pos_top{
  position: relative;
  top:-19px;
}
#content{
  margin: 0;
  text-align:justify;
}
#content.pos_left{
  position: relative;
  left: 50px;
}
h1{
    color: blue; 
}
h1.pos_left{
  position: relative;
  left: 50px;
}
h3{
  color: blue;
}
nav p {
  text-align:center;
}
a {
  text-decoration: none;
  color: blue;
}
footer.pos_top{
  position:relative;
  top:420px;
}
#footer{
  text-align: center;
  color: blue; 
}
li{
  margin: 10px;
}
footer{
  background-color: #ff6;
  padding: 15px;
}

4 Answers

Check this one!

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>introduction</title>
        <link rel="stylesheet" href="main.css">
    </head>

    <body>
          <div id="header">
            <header>
                <h1 class="heading">C# Tutorial</h1>
            </header>
          </div>
          <section>
                <div id="menu" class="pos_top">
                        <nav>
                            <p>Navegacion</p>
                            <ul>
                                <li><a href="variables.html">Variables</a></li><br>
                                <li><a href="controlstructures.html">Control Structures</a></li><br>
                                <li><a href="loops.html">Loops </a></li>
                            </ul>
                        </nav>
                </div> <!--menu DIV CLOSE -->
                <!-- Content DIV OPEN-->
                <div id="content">
                        <h3>Introduccion</h3>
                        <p>Bienvenidos al tutorial de C#. En este tutorial aprenderan a como se declaran variables, las estructuras de controles y<br> tambien conoseran los loops. Pero primero deberan aprender y entender lo que es C#.</p>
                        <p><br>¿Que es C#?<br>C# es un lenguaje de programación que se ha diseñado para compilar diversas aplicaciones que se ejecutan en .NET Framework. C# es simple, eficaz, con seguridad de tipos y orientado a objetos. <br>Las numerosas innovaciones de C# permiten desarrollar aplicaciones rápidamente y mantener la expresividad y elegancia de los lenguajes de estilo de C.</p>
               </div><!-- Content DIV CLOSE-->
        </section>  <!-- SECTION CLOSE-->
        <div id="footer">
              <footer class="pos_top">
                    <h2>&copy;2014 Christopher Ponce</h2>
              </footer>
        </div>


    </body>
</html>
.heading{
    width: 80%;
    margin: 0 auto;
    text-align: center;
    border: 2px solid;
}

#menu{
    width: 20%;
    float: left;
    background-color: cyan;
}

nav p{
    text-align: center;
}

#content{
    margin-right: 30px;
    background-color: blue;
}
nav ul li{
    margin-left: 30%;
} 

#content{
    float: right;
    width: 77%;
}

#footer{
    clear: both;
    border: 2px solid;
    text-align: center;
}

You'll need to remember that you cannot apply both positioning and a float to an element, because it does create conflicting positioning schemes and disable the navigation links.

I do not understand why you have both ID and class for almost all elements. It is no point having both ID and class. Since both points to the same block of elements.

You should remove all duplicate selectors from CSS and HTML to work this one properly.

Christopher Ponce
Christopher Ponce
2,766 Points

wow thanks alot i was trying to clean my code but thanks ill take example from it

This CSS may be useful. Try this!

.heading{
    width: 80%;
    margin: 0 auto;
    text-align: center;
    border: 2px solid;
}

#menu{
    width: 20%;
    float: left;
}

nav p{
    text-align: center;
    font-weight: bold;
}

#content{
    margin-right: 30px;

}
nav ul li{
    margin-left: 30%;
} 

#content{
    width: 70%;
    float: left;
}

#footer{
    clear: both;
    border: 2px solid;
    text-align: center;
}