This repository contains a basic HTML webpage that allows users to change the background color of the page using a color switcher. The webpage includes the following
Components:
HTML File (index.html):
The main structure of the webpage. Contains a header, color switcher, an image, and a paragraph of text. Utilizes the "style.css" stylesheet for styling and the "script.js" script for interactivity.
CSS Stylesheet (style.css):
Defines the styling for various elements on the webpage. Sets up padding, margins, text alignment, image properties, and more. Formats the color switcher buttons and their colors.
JavaScript Script (script.js):
Implements the functionality to change the background color of the page. Defines a function changeBg(color) that accepts a color parameter. Updates the background color of the element and text colors based on the selected color. Interacts with the HTML elements using DOM manipulation. To use this code, simply clone the repository and open the index.html file in a web browser. The color switcher buttons allow you to change the background color of the page, and the text color adapts for better visibility.
Please note that this is a basic example and can be further extended with additional features and improvements.