JSFiddle - React, Tailwind, and code Playground

by Janaka_Ravindra

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <title>Hi There! Aziz</title>


    <link rel="stylesheet" href="style.css">
</head>

<body>
    <div class="container">

        <!-- -------------Header/Banner------------- -->

        <div class="header">
            <a href="#" class="logo">ABDUL <span>AZIZ</span></a>
            <div class="links">
                <a href="#"><i class="comLink fa fa-facebook-square fa-2x"></i></a>
                <a href="#"><i class="comLink fa fa-github-square fa-2x"></i></a>
                <a href="#"><i class="comLink fa fa-linkedin-square fa-2x"></i></a>
                <a href="#"><i class="comLink fa fa-behance-square fa-2x"></i></a>
                <form action="#">
                    <input type="text" placeholder="Search...">
                    <button class="btn" type="submit"><i class="fa fa-search"></i></button>
                </form>
            </div>

        </div>


        <!-- -------------Navigation Bar------------- -->
	<div class ="myDIV">              <!-- here is the DIV I added-->
        <div class="sidebar">
            <a class="active" href="#home">Home</a>
            <a href="#services">Example 1</a>
            <a href="#portfolio">Example 2</a>
            <a href="#about">Example 3</a>
            <a href="#contact">Example 4</a>
        </div>
        
        <div class="col">
            <div class="content">
                <div class="section1">
                    <h2>Responsive Sidebar Example</h2>
                    <p>This example use media queries to transform the sidebar to a top navigation bar when the screen
                        size
                        is
                        700px or less.
                    </p>
                    <p>We have also...

CSS

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato&display=swap');

*{
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

.container{
    max-width: 1400px;
    margin: auto;
}
.header{                /* Header */
    padding: 10px 20px;
    background-image: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)),url(/assets/top.jpg);
    background-size: cover;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    
}
   
.fa{                     /* icon color */
    color: white;
}
.comLink:hover{          /* icon hover */
    color: #ccc;
}

input{                  /* Search input*/
    margin-top: 8px;
    padding:6px ;
    border: 1px solid #ccc;
    width: 70%;
    border-radius: 4px;
}
.btn{                   /* Search Button */
    padding: 7.5px;
    background:#f44336 ;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}
.btn:hover{                /* Button hover */
    background: #FF7F50;
}
.links a{
    padding-left: 19px;
}

.logo{                      /* Logo */
    font-family: 'Roboto', sans-serif;
   padding: 40px 0px;
   font-size: 30px;
   text-decoration: none;
   color: white;
   letter-spacing: 8px;
}
span{
    color: #f44336;
}

a{
    text-decoration: none;
}

.myDIV{         /* here is my changes */
  display:flex;
}

li{
    list-style: none;
}
   
.sidebar {
  display:flex; /* here is the changes */
  flex-direction:column; /* here is the changes */
  margin: 0;
  padding: 0;
  width: 200px;
  background-color: #f1f1f1;
  height: 100%;
  overflow: auto;
  position: relative;
}

.sidebar a {
    font-family: 'Lato', sans-serif;
  display: block;
  color: black;
  padding: 16px;
  text-decoration: none;
}
 
.sidebar a.active {
  background-color: #f44336;
  color: white;
}

.sidebar a:hover:not(.active) {
  background-color: #555;
  color: white;
}

/* Content...