Skip to content

Instantly share code, notes, and snippets.

@code-boxx
Last active December 8, 2023 02:38
Show Gist options
  • Save code-boxx/f5572f6b41a3d5a2f922c036cc858691 to your computer and use it in GitHub Desktop.
Save code-boxx/f5572f6b41a3d5a2f922c036cc858691 to your computer and use it in GitHub Desktop.
Simple HTML CSS Admin Panel

SIMPLE HTML CSS ADMIN PANEL

https://code-boxx.com/math-equations-html/

IMAGE

admin

LICENSE

Copyright by Code Boxx

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

<!DOCTYPE html>
<html>
<head>
<title>Pure HTML CSS Admin Template</title>
<meta charset="utf-8">
<style>
/* (A) FORM */
.form {
max-width: 600px; /* optional */
padding: 20px;
border: 1px solid #eee;
background: #f2f2f2;
}
/* (B) FIELDS & LABELS */
.form label, .form input, .form textarea, .form select, .form button {
display: block;
width: 100%;
}
.form label { padding: 10px 0; }
.form input, .form textarea, .form select { padding: 10px; }
/* (C) BUTTONS */
input[type=button], input[type=submit], button {
font-size: 1em;
font-weight: 700;
padding: 10px;
border: 0;
color: #fff;
background: #870000;
cursor: pointer;
}
input[type=submit] { margin-top: 20px; }
/* (X) DOES NOT MATTER */
* {
font-family: Arial, Helvetica, sans-serif;
box-sizing: border-box;
}
</style>
</head>
<body>
<form class="form">
<label for="demoA">Field A</label>
<input type="text" id="demoA">
<label for="demoB">Field B</label>
<textarea id="demoB"></textarea>
<label for="demoC">Field C</label>
<select id="demoC">
<option>Option A</option>
</select>
<input type="submit" value="Go">
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Pure HTML CSS Admin Template</title>
<meta charset="utf-8">
<style>
/* (A) ZEBRA TABLE */
table.zebra {
width: 100%;
border-collapse: collapse;
}
table.zebra tr:nth-child(odd) { background: #f2f2f2; }
table.zebra td { padding: 10px; }
/* (B) ZEBRA LIST */
ul.zebra, ol.zebra {
padding: 0;
margin: 0;
list-style: none;
}
ul.zebra li, ol.zebra li { padding: 10px; }
ul.zebra li:nth-child(odd), ol.zebra li:nth-child(odd) { background: #f2f2f2; }
/* (X) DOES NOT MATTER */
* {
font-family: Arial, Helvetica, sans-serif;
box-sizing: border-box;
}
</style>
</head>
<body>
<!-- (A) ZEBRA TABLE -->
<table class="zebra">
<tr>
<td>Cell</td> <td>Cell</td> <td>Cell</td>
</tr>
<tr>
<td>Cell</td> <td>Cell</td> <td>Cell</td>
</tr>
<tr>
<td>Cell</td> <td>Cell</td> <td>Cell</td>
</tr>
</table>
<br><br>
<!-- (B) ZEBRA LIST -->
<ul class="zebra">
<li>Row</li> <li>Row</li>
<li>Row</li> <li>Row</li>
</ul>
</body>
</html>
/* (A) GLOBAL */
* {
font-family: Arial, Helvetica, sans-serif;
box-sizing: border-box;
}
body {
display: flex;
min-height: 100vh;
padding: 0; margin: 0;
}
/* (B) SIDEBAR */
/* (B1) SIDEBAR ITSELF */
#pgside {
width: 200px;
flex-shrink: 0;
transition: width 0.2s;
background: #283039;
}
/* (B2) USER OR BRANDING */
#pguser {
display: flex;
align-items: center;
padding: 10px 5px;
}
#pguser img {
width: 50px; height: 50px;
object-fit: contain;
margin-right: 10px;
border-radius: 50%
}
/* (B3) SIDEBAR ITEMS */
#pgside, #pgside a { color: #fff; }
#pgside a {
display: block;
padding: 20px;
width: 100%;
text-decoration: none;
cursor: pointer;
}
#pgside a.current { background: #7c1919; }
#pgside a:hover { background: #9b2323; }
/* (B4) SIDEBAR ICONS & TEXT */
#pgside i.ico, #pgside i.txt { font-style: normal; }
#pgside i.ico {
font-size: 1.1em;
margin-right: 10px;
}
/* (B5) SMALL SCREEN TRANSFORMATION */
@media screen and (max-width:768px) {
#pgside { width: 70px; }
#pgside i.txt { display: none; }
#pgside i.ico {
font-size: 1.5em;
margin-right: 0;
}
#pguser { justify-content: center; }
#pguser img { margin-right: 0; }
#pgside a {
text-align: center;
padding: 20px 0;
}
}
/* (C) MAIN CONTENTS */
#pgmain {
flex-grow: 1;
padding: 20px;
background: #f2f2f2;
}
<!DOCTYPE html>
<html>
<head>
<title>Pure HTML CSS Admin Template</title>
<meta charset="utf-8">
<meta name="robots" content="noindex">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.5">
<link rel="stylesheet" href="admin.css">
</head>
<body>
<!-- (A) SIDEBAR -->
<div id="pgside">
<!-- (A1) BRANDING OR USER -->
<!-- LINK TO DASHBOARD OR LOGOUT -->
<div id="pguser">
<img src="admin.png">
<i class="txt">MY ADMIN</i>
</div>
<!-- (A2) MENU ITEMS -->
<a href="#" class="current">
<i class="ico">&#9733;</i>
<i class="txt">Section A</i>
</a>
<a href="#">
<i class="ico">&#9728;</i>
<i class="txt">Section B</i>
</a>
<a href="#">
<i class="ico">&#9737;</i>
<i class="txt">Section C</i>
</a>
</div>
<!-- (B) MAIN -->
<main id="pgmain">
Main
</main>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment