O

Loading portfolio

All posts

SecureM4: Cybersecurity Landing Page (Learning Project)

1 February 2024 · 4 min read · By Olubisi Olumide Sodiq

The goal

Early on, I wanted a project that would force me to use every common part of a marketing website: navbar, hero, cards, pricing tables, testimonials, a carousel, an embedded map and a contact form. A cybersecurity company landing page covers all of it, so I rebuilt one from a template design and used it as practice.

View the live page on CodePen https://codepen.io/Olumide-commits/pen/qByzZJP

A quick note on honesty: the company, the team, the prices and the testimonials are all made up, and the images come from a free template. What is real is the code and the lessons, which are what this post is about.

What I built A responsive navbar that collapses into a menu button on phones A hero banner and three feature cards Statistics, progress bars and a three-plan pricing section A team section and a testimonial carousel An embedded map and a feedback form with validation

Stack: HTML, CSS, Bootstrap 5 and a small amount of vanilla JavaScript.

Lesson 1: Fixed sizes break responsive layouts

My first version gave every feature image a fixed size of 280 by 280 pixels. On a wide screen it looked fine. At tablet and phone widths the cards were narrower than the images, so pictures spilled out of their cards and the three cards ended up different sizes.

The fix was to let the image follow its card instead of the other way round:

css .img-resize { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

width: 100% makes the image fill the card, aspect-ratio keeps every image the same shape, and object-fit: cover crops instead of stretching. The same lesson applied to the Google Maps embed, which had a fixed width="900". Wrapping it in Bootstrap's ratio ratio-16x9 helper made it scale with its container.

Rule I now follow: if a size is written in pixels on an image or an embed, ask what happens at 360px wide.

Lesson 2: One missing can hide for a long time

Two of my opening div tags were never closed, so half the page was quietly nested inside a row. Browsers repair that kind of mistake, so nothing looked broken, but the layout was fragile and hard to change. I only found it by counting opening and closing tags and properly indenting the code. A code editor with tag matching, or an HTML validator, would have caught it on day one.

Lesson 3: A form that does nothing feels broken

My first contact form had inputs and a Submit button, and the button did nothing. Making it behave like a real form taught me four things:

Use the right input types. type="email" and type="tel" give you free validation and the right keyboard on phones. Validate before you submit. Calling form.checkValidity() stops bad data and lets Bootstrap show which fields need fixing. Give feedback at every step. A spinner while "sending" and a clear success message afterwards make the page feel finished. Never trust what users type. The thank-you message includes the visitor's name, so I escape it before putting it into the page: js function escapeHtml(text) { var div = document.createElement('div'); div.textContent = text; return div.innerHTML; }

The form is a demo and sends nothing. Connecting a form to a real backend is what I learned next with Laravel, where messages are validated on the server and stored in a database.

Lesson 4: Small accessibility habits cost almost nothing

I replaced alt="..." with real descriptions, hid labels visually instead of deleting them, and marked the form's message area with role="status" so screen readers announce it. None of this changes how the page looks, and all of it changes who can use it.

What I would do differently today Design mobile first and test at 360px before anything else. Use real content from the first draft. Turn the repeated cards into reusable components instead of copying and pasting markup. This is exactly why I moved to Laravel Blade and Vue. Use Tailwind CSS to keep the HTML shorter than Bootstrap's long class lists. Check the finished page with a validator and an accessibility checker before calling it done. Takeaway

SecureM4 is not my most impressive project, and that is why it was useful. It is where layout, spacing and responsive behaviour stopped being theory and became habits. If you are learning, rebuild a design you admire, then go back and fix what you got wrong. The second pass teaches more than the first.

If you want to see how these skills grew, have a look at my other projects, including a Laravel e-commerce store and a university voting platform.

Want to talk about a project or a role? Get in touch.