cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <html>

<head>

  <meta charset="UTF-8">

  <title>CodePen - A Pen by  Captain Anonymous</title>

    <link rel="stylesheet" href="css/style.css" media="screen" type="text/css" />

</head>

<body>

  <!--this is the menu -->
<div id="menu">
  <ul>
    <li onmouseover="onColor(this)" onmouseout="offColor(this)">
      <a href="#home">Home</a>
    </li>
    <li onmouseover="onColor(this)" onmouseout="offColor(this)">
      <a href="#about">About</a>
    </li>
    <li onmouseover="onColor(this)" onmouseout="offColor(this)">
      <a href="#contact">Contact</a>
    </li>
  </ul>
</div>
<!--this is the content of the page-->
<div id="welcome">
  <p>Welcome to my website</p>
  <ul>
    <li>Another</li>
    <li>List</li>
    <li>Not Selected by CSS</li>
 <div>
   
   <!DOCTYPE html>
<html>
<body>

<button onclick="getElementById('demo').innerHTML=Date()">What does this button do? How?</button>
  
  

<p id="demo"></p>

</body>
</html>


  <script src="js/index.js"></script>

</body>

</html>
            
          
!
            
              #menu ul {
    list-style-type: none;
    margin: 0; /*try changing this num*/
    padding: 0; /*try changing this num*/
    overflow: hidden; /*try removing*/
}

#menu li {
    float: left; /*try center or right*/
    padding: 10px;
    width: 100px; /*try changing this num*/
    background-color: orange;
    border-style: ridge;
}

/*#menu li:hover {
  background-color: green;
}*/
            
          
!
            
              function onColor(listElement) {
    listElement.style.background = "green";
}

function offColor(listElement) {
    listElement.style.background = "orange"; 
}
            
          
!
999px
Loading ..................

Console