Difference between revisions of "Team:Linkoping Sweden/Description"

Line 3: Line 3:
 
<html>
 
<html>
 
<head>
 
<head>
<style>
 
body {margin:0;}
 
  
/* Vill att endast Home (och inte med DropdownX) visas då bredden är mindre än 600px (då visas även de tre strecken till höger för att expandera menyn). DropdownX ska visa tre Link både då skärmen är större och mindre än 600px.*/
 
/* Vill kombinera dessa:*/
 
/* <https://www.w3schools.com/howto/howto_js_topnav_responsive.asp> */
 
/* <https://www.w3schools.com/css/css_dropdowns.asp> (dropdown navbaren längst ner används i koden nedan). */
 
 
/* Add a background color to the top navigation */
 
.topnav, uses {
 
  overflow: hidden;
 
  background-color: #019966;
 
}
 
 
 
/* Style the links inside the navigation bar, used by non-lists/non-buttons */
 
.topnav a {
 
  float: left;
 
  display: block;
 
  color: white;
 
  text-align: center;
 
  padding: 14px 16px;
 
  text-decoration: none;
 
  font-size: 17px;
 
}
 
 
/* Change the color of links on hover that aren't lists, uses */
 
.topnav a:hover {
 
  background-color: white;
 
  color: #019966;
 
}
 
 
/* Hide the link that should open and close the topnav on small screens */
 
.topnav .icon {
 
  display: none;
 
}
 
 
 
/* Show the dropdown menu on hover, this most be above css for screen smaller then 600px */
 
.topnav .dropdown:hover .dropdown-content {
 
    display: block;
 
}
 
 
 
/* When the screen is less than 600 pixels wide, hide all links, except for the first one ("Home"). Show the link that contains should open and close the topnav (.icon) */
 
@media screen and (max-width: 600px) {
 
 
  .dropdown {display: none;}
 
  .topnav a:not(:first-child) {display: none;}
 
  .topnav a.icon {
 
    float: right;
 
    display: block;
 
  }
 
}
 
 
/* The "responsive" class is added to the topnav with JavaScript when the user clicks on the icon. This class makes the topnav look good on small screens (display the links vertically instead of horizontally) */
 
@media screen and (max-width: 600px) {
 
  .topnav.responsive {position: relative;}
 
  .topnav.responsive .icon {
 
    position: absolute;
 
    right: 0;
 
    top: 0;
 
  }
 
 
.topnav.responsive .dropdown:hover .dropdown-content {
 
    position: relative;
 
    display: block;
 
}
 
 
  .topnav.responsive .dropdown {
 
    display: block;
 
    text-align: left;
 
    width:100%;
 
    }
 
 
  .topnav.responsive a {
 
    float: none;
 
    display: block;
 
    text-align: left;
 
  }
 
 
}
 
 
 
/* LIST */
 
/* The container <div> - needed to position the dropdown content, uses */
 
.dropdown {
 
    float: left;
 
border: 1px;
 
    border-style: solid;
 
    border-color: #019966;
 
    /*overflow: hidden;*/
 
 
}
 
 
/* Dropdown list Button, uses */
 
.dropdown .dropbtn {
 
    font-size: 16px;   
 
    border: none;
 
    outline: none;
 
    color: red;
 
    padding: 14px 16px;
 
display: inline-block;
 
    background-color: inherit; /*inherited from .topnav*/
 
 
}
 
 
/* Background color of menu when hovering, uses */
 
.container a:hover, .dropdown:hover {
 
    background-color: white;
 
color: #019966;
 
}
 
 
/* Text color when hovering list button, uses */
 
.dropbtn:hover {
 
    color: #019966;
 
}
 
 
/* Dropdown Content (Hidden by Default), uses */
 
.dropdown-content {
 
    display: none;
 
    position: absolute;
 
    background-color: #019966;
 
 
    min-width: 160px;
 
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
 
    z-index: 1;
 
}
 
 
/* Links inside the dropdown, uses */
 
.dropdown-content a {
 
    float: none;
 
    color: #FFF;
 
    border-left: 0px;
 
    border-right: 0px;
 
    border-bottom: 0px;
 
border-top: 1px;
 
    border-style: solid;
 
    border-color: #019966;
 
    padding: 12px 16px;
 
    text-decoration: none;
 
    display: block;
 
    text-align: left;
 
}
 
 
/* Change to this color of dropdown links on hover, uses */
 
.dropdown-content a:hover {
 
    background-color: #FFF;
 
color: #019966;
 
}
 
 
 
 
 
 
</style>
 
 
</head>
 
</head>
 
<body>
 
<body>

Revision as of 11:59, 20 June 2017

Responsive Topnav Example

Resize the browser window to see how it works.