Advertisement
Rattlesnake18

How to creat a navigation bar using html and css

Jul 20th, 2019
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Nav_bar</title>
  8.     <link rel="stylesheet" href="style.css">
  9. </head>
  10. <body>
  11.    <ul>
  12.        <li><a>Home</a></li>
  13.        <li><a>Contact</a>
  14.         <ul>
  15.             <li><a>personalnumber</a></li>
  16.             <li><a>Phone number</a></li>
  17.             <li><a>Email</a></li>
  18.         </ul></li>
  19.        <li><a>About</a></li>
  20.        <li><a>Rainyfacts</a>
  21.     <ul>
  22.         <li><a>Drazy</a></li>
  23.         <li><a>Over cast</a></li>
  24.     </ul></li>
  25.        <li><a>News</a></li>
  26.    </ul>
  27. </body>
  28. </html>
  29. And the css file is here::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::lol;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  30. body{
  31.     background:url(john-noonan-E-9CFTftQh4-unsplash.jpg);
  32.     background-size: cover;
  33.     font-style:italic;
  34.     color:goldenrod;
  35. }
  36. ul{
  37.     padding: 0px;
  38.     margin: 0px;
  39.     list-style:none;
  40.  
  41. }
  42. li{
  43.     float: left;
  44.     width: 250px;
  45.     height: 50px;
  46.     background-color: black;
  47.     opacity: 0.8;
  48.     line-height: 20px;
  49.     text-align: center;
  50.     font-size: 20px;
  51. }
  52.  
  53. ul li a{
  54.     text-decoration: none;
  55.     color: goldenrod;
  56.     display: block;
  57. }
  58.  
  59.  
  60.  
  61.  
  62. ul li a:hover{
  63.     background-color: green;
  64. }
  65.  
  66.  
  67. ul li  ul li{
  68.     display: none;
  69.  
  70. }
  71. ul li:hover ul li{
  72.     display: block;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement