Search
 
SCRIPT & CODE EXAMPLE
 

CSS

responsive header with logo and menu

<!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, Helvetica, sans-serif;
}

.topnav {
  overflow: hidden;
  background-color: #333;
}

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

.topnav a:hover {
  background-color: #ddd;
  color: black;
}

.topnav a.active {
  background-color: #04AA6D;
  color: white;
}

.topnav .icon {
  display: none;
}

@media screen and (max-width: 600px) {
  .topnav a:not(:first-child) {display: none;}
  .topnav a.icon {
    float: right;
    display: block;
  }
}

@media screen and (max-width: 600px) {
  .topnav.responsive {position: relative;}
  .topnav.responsive .icon {
    position: absolute;
    right: 0;
    top: 0;
  }
  .topnav.responsive a {
    float: none;
    display: block;
    text-align: left;
  }
}
</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);" class="icon" onclick="myFunction()">
    <i class="fa fa-bars"></i>
  </a>
</div>

<div style="padding-left:16px">
  <h2>Responsive Topnav Example</h2>
  <p>Resize the browser window to see how it works.</p>
</div>

<script>
function myFunction() {
  var x = document.getElementById("myTopnav");
  if (x.className === "topnav") {
    x.className += " responsive";
  } else {
    x.className = "topnav";
  }
}
</script>

</body>
</html>
Comment

responsive header with logo and menu css code

<div class="header">
  <a href="#default" class="logo">CompanyLogo</a>
  <div class="header-right">
    <a class="active" href="#home">Home</a>
    <a href="#contact">Contact</a>
    <a href="#about">About</a>
  </div>
</div>
Comment

PREVIOUS NEXT
Code Example
Css :: next day 2pm delivery countdown timer script 
Css :: css keep focus color on div after click 
Css :: how to stop a blue color on touch in css 
Css :: css ul shifts 
Css :: unable to select text in website css cursor type 
Css :: angular set encapsulated body to full height 
Css :: ios sms css 
Css :: index.css code not working in 000webhost 
Css :: transform translate css 
Css :: css safari webkit input search icon hide 
Css :: edit default theme in component angular css 
Css :: material css navbar 
Css :: calmp css 
Css :: 3d trapezoid 
Css :: split group of flex item 
Css :: css youtube video get rid of black border 
Css :: wordpress localhost css not working 
Css :: p::after p::before css 
Css :: flot css mdn 
Css :: <asp:FileUpload ID="Fu_Result" runat="server" Width="250px" CssClass="inputfile" / 
Css :: fullcalendar react 
Css :: fixed with 
Css :: css animation 3d effect 
Typescript :: prettier not working with tsx 
Typescript :: matplotlib subplots size 
Typescript :: javax.validation.constraints does not exist 
Typescript :: from sklearn.datasets import fetch_mldata error 
Typescript :: add column if not exists postgresql 
Typescript :: angular material button css not working 
Typescript :: useStae with array of strings typescript 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =