
OLP — Online Learning Template
Free, responsive HTML/CSS/JS learning template for students—header/nav, categories, course pages, lessons, search & quiz. Easy to customize; no frameworks.
- Source code and assets
- README with setup & deploy guides
- Lifetime updates to this template
Template details
What’s in the project
Pages
404.html
— Page Not Found (H1: 404)about.html
— About — OLP (H1: About)admin-dashboard.html
— Admin Dashboard — OLP (H1: Admin Dashboard)admin-login.html
— Admin Login — OLP (H1: Admin Login)categories.html
— OLP — Categories (H1: Categories)category.html
— OLP — Category (H1: Category)

contact.html
— Contact — OLP (H1: Contact)course.html
— OLP — Course (H1: Course)faq.html
— FAQ — OLP (H1: FAQ)index.html
— OLP — Home (H1: Learn fast with concise, hands‑on courses.)learn.html
— OLP — Learn (H1: Lesson)quiz.html
— OLP — Quiz (H1: Quiz:)result.html
— OLP — Result (H1: Quiz Result)search.html
— OLP — Search (H1: Search)
Assets
assets/css/styles.css
— global styles, layout, components, responsive nav & sticky headerassets/js/app.js
— theme toggle, mobile menu, helpers (OLP
namespace)assets/js/pages/…
— page-specific scripts: admin-dashboard.js, admin-login.js, categories.js, category.js, course.js, home.js, learn.js, quiz.js, result.js, search.jsassets/data/courses.json
— categories, course list, lessons, quizzesassets/img/course-default.svg
— placeholder image
Tech stack: HTML, CSS, Vanilla JS (with jQuery loaded), no build tools.
What’s in the project
Pages
404.html
— Page Not Found (H1: 404)about.html
— About — OLP (H1: About)admin-dashboard.html
— Admin Dashboard — OLP (H1: Admin Dashboard)

admin-login.html
— Admin Login — OLP (H1: Admin Login)categories.html
— OLP — Categories (H1: Categories)category.html
— OLP — Category (H1: Category)contact.html
— Contact — OLP (H1: Contact)course.html
— OLP — Course (H1: Course)faq.html
— FAQ — OLP (H1: FAQ)index.html
— OLP — Home (H1: Learn fast with concise, hands‑on courses.)

learn.html
— OLP — Learn (H1: Lesson)quiz.html
— OLP — Quiz (H1: Quiz:)result.html
— OLP — Result (H1: Quiz Result)search.html
— OLP — Search (H1: Search)
Assets

assets/css/styles.css
— global styles, layout, components, responsive nav & sticky headerassets/js/app.js
— theme toggle, mobile menu, helpers (OLP
namespace)assets/js/pages/…
— page-specific scripts: admin-dashboard.js, admin-login.js, categories.js, category.js, course.js, home.js, learn.js, quiz.js, result.js, search.jsassets/data/courses.json
— categories, course list, lessons, quizzesassets/img/course-default.svg
— placeholder image
Tech stack: HTML, CSS, Vanilla JS (with jQuery loaded), no build tools.
:root { --brand: #7c3aed; --accent: #0ea5e9; }
Navigation
- Update links in each page’s header
<nav id="primaryNav">
. - Mobile behavior is controlled in
app.js
(toggle) and CSS@media (max-width: 900px)
.
Grids & Cards
- Utilities:
.grid
,.grid.cols-3
,.grid.cols-4
with breakpoints at 900px and 600px. - Cards use
.card
; adjust padding, borders, and radius there.
Buttons & Forms
.btn
and.btn.primary
set rounding, borders, and gradients.- Inputs (
.input
,select
,textarea
) share base styles—override per page when needed.
Course Detail layout
- The desktop 2‑col grid is in the HTML as an inline style. A mobile override in CSS forces single column at ≤900px. If you prefer CSS‑only, move the inline grid to a class and remove the inline style.
Data model (courses.json
)
- Categories: 9 entries (e.g., Programming, Data Science, Design, Marketing, Cloud, AI…).
- Course fields (per course):
id, slug, title, category, level, duration_hours, rating, price, image, description, lessons, quiz
Adding a course:
- Open
assets/data/courses.json
. - Append a new object to
courses[]
with the fields above. - Use a unique
id
and (optionally) a friendlyslug
. - Provide
lessons[]
with{id, title, type, content}
. - Optionally add a
quiz[]
with{question, options[], answerIndex}
. - Point
image
to a file inassets/img/
.
How pages find data:
- Scripts call
OLP.loadData()
(inapp.js
) to fetch the JSON and cache it. - Detail pages read URL params (e.g.,
id
) to select the right course.
⚠️ Local dev tip: Becausefetch()
can’t read files fromfile://
, run a tiny server locally:python -m http.server
from the project root and openhttp://localhost:8000
.
Responsive behavior & sticky header
- Header is sticky (
position: sticky; top: 0
) and adds a shadow once you scroll (via a small JS class toggle). - Mobile menu shows a hamburger at ≤900px, revealing a slide‑down panel; links become block‑level for easy tapping.
- Grids collapse progressively at 900px and 600px for comfortable reading.
- Course Detail sidebar drops below the content on small screens.
Edit breakpoints in the final @media
blocks assets/css/styles.css
to suit your audience.
Getting started (local & deploy)
Local
- Clone or unzip the project.
- From the project root, run:
python -m http.server
- Visit
http://localhost:8000
.
Deploy (static hosting)
- GitHub Pages, Netlify, Vercel, S3/CloudFront all work—no build step needed.
- Ensure
assets/
is cached, and JSON is served with the correct MIME type.
Free for students
This template is free to use, learn from, and extend for student projects and clubs. Duplicate it, customize the palette and copy, add new pages (Resources, Blog, Portfolio), and publish as your learning hub.
If you remix it, a small attribution back to the original is appreciated.
Credits & license
- Project name: OLP (Open Learning Portal)
- Authors: FirstAyo/CraftedTemplate
- License: Free for educational use