Skip to content

Instantly share code, notes, and snippets.

View semiarthanoian's full-sized avatar

Semi Art semiarthanoian

  • Hanoi, Vietnam
View GitHub Profile
body {
/* preserve navbar */
padding-top: 62px;
}
.bg-dark {
background-color: Black !important;
}
.bg-light {
<!doctype html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Homepage - Bootstrap It !</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>A responsive navigation bar</title>
<link rel="stylesheet" href="master.css">
</head>
<body>
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* Reseting CSS
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Một cái dropdown kỳ lạ :D</title>
<link rel="stylesheet" href="dropdown.css">
</head>
<body>
<div class="dropdown">
.dropdown {
font-family: Arial, sans-serif;
font-size: 16px;
display: inline-block;
position: relative;
}
.dropdown-btn {
font-size: 14px;
.dropdown {
font-family: Arial, sans-serif;
font-size: 16px;
display: inline-block;
position: relative;
}
.dropdown-btn {
font-size: 14px;
var toggleTheList = function(event) {
var theBtn = event.target;
var theList = theBtn.nextElementSibling;
var theListIsHidden = theList.className.includes('hidden');
if (theListIsHidden)
theList.className = 'dropdown-list shown';
else
theList.className = 'dropdown-list hidden';
};
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>A Normal Dropdown</title>
.dropdown {
font-family: Arial, sans-serif;
font-size: 16px;
display: inline-block;
position: relative;
}
.dropdown-btn {
font-size: 14px;