A simple and responsive web app to convert between metric and imperial units.
Built using HTML, CSS, and JavaScript.
- Convert between:
- Length β meters β feet
- Volume β liters β gallons
- Mass β kilograms β pounds
- Responsive layout that adapts to desktop, tablet, and mobile.
- Real-time conversion on button click.
- Clean, minimal UI with distinct sections for each type of conversion.
- Enter a number into the input field.
- Click the Convert button.
- See the results instantly in all three categories: Length, Volume, and Mass.
- HTML β Structure
- CSS β Styling + Responsive Design
- JavaScript β Conversion logic
βββ index.html # Main app structure βββ index.css # Styling and responsiveness βββ index.js # Conversion logic
- 1 meter = 3.281 feet
- 1 liter = 0.264 gallon
- 1 kilogram = 2.204 pounds
Hero section for input + conversion button, followed by three result cards for:
- Length (Meter/Feet)
- Volume (Liters/Gallons)
- Mass (Kilograms/Pounds)
- Desktop β Centered layout with wide cards.
- Tablet β Scales down input/button size.
- Mobile β Full-width cards and smaller text for readability.
- Clone this repo or download the files.
- Open
index.html
in your browser. - Start converting units π
- Add temperature conversions (Β°C β Β°F β K).
- Support live conversion as the user types.
- Add a dark/light mode toggle.
Built with β€οΈ by Rayyan Khattak using HTML, CSS, and JavaScript.