martes, 6 de agosto de 2019

plantilla practica

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>

body {

  margin:0;font-family:Arial
}
.topnav {
  overflow: hidden;
  background-color: #333;
}

.topnav a{
text-decoration: none;
color: #f2f2f2;
float: left;
display: block;
text-align: center;
padding: 14px 16px;
font-weight: bold;
font-size: 17px;

}

.active {
  background-color: #4CAF50;
  color: white;
}

.topnav .icon {
  display: none;
}


.topnav a:hover{
  background-color: #555;
  color: white;

}

@media screen and (max-width: 600px) {

.topnav a:not(:first-child) {
    display: none;
  }

  .topnav a.icon {
    float: right;
    display: block;
  }


   .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: center;
  }
 

}


</style>

</head>
<body>
<div class="topnav" id="myTopnav">
  <a href="#home" class="active">Home</a>
  <a href="#news">News</a>
  <a href="#contact">Contact</a>
 
  <a href="#about">About</a>
  <a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="myFunction()">&#9776;</a>
</div>

<div style="padding-left:16px">
  <h2>Responsive Topnav with Dropdown</h2>
  <p>Resize the browser window to see how it works.</p>
  <p>Hover over the dropdown button to open the dropdown menu.</p>
</div>
<script>
function myFunction() {
  var x = document.getElementById("myTopnav");
  if (x.className === "topnav") {
    x.className += " responsive";
  } else {
    x.className = "topnav";
  }
}
</script>
</body>
</html>

No hay comentarios:

Publicar un comentario