Yathin Babu - LearnWebstack.com https://www.learnwebstack.com Courses on web tools and technologies Thu, 16 Nov 2023 13:59:13 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 https://www.learnwebstack.com/wp-content/uploads/2023/06/logo-tranparent-150x150.png Yathin Babu - LearnWebstack.com https://www.learnwebstack.com 32 32 Hosting Your Static Website on Netlify: A Step-by-Step Guide https://www.learnwebstack.com/hosting-your-static-website-on-netlify-a-step-by-step-guide/ Tue, 07 Nov 2023 13:24:43 +0000 https://www.learnwebstack.com/?p=5342 In this step-by-step guide, we'll walk you through the process of hosting your static website on Netlify.

The post Hosting Your Static Website on Netlify: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Netlify — netlify.com

Hosting a static website has never been easier, and Netlify is one of the top choices for developers. It offers a convenient platform to host your static website quickly and for free. In this step-by-step article, we’ll walk you through the process of hosting your static website on Netlify, ensuring it’s accessible to the world.

Prepare Your Website

Before you get started with hosting on Netlify, make sure your static website is fully prepared. Here’s a quick checklist:

  • HTML files for your webpages.
  • CSS files for styling.
  • JavaScript files for interactivity (if needed).
  • Any additional assets like images or fonts.
  • Push your code to GitHub

Create a Netlify Account

To get started with Netlify, you’ll need an account. If you don’t have one, you can easily sign up at Netlify.

  1. Sign Up: If you’re not already signed up, go to Netlify’s website and sign up for a free account.
ADVERTISEMENT

Deploy Your Website on Netlify

Once you’ve prepared your website and created a Netlify account, it’s time to deploy your site.

  1. Log In to Netlify:

    • Log in to your Netlify account.
  2. New Site from Git:

    • Click on the “Import from Git” button on your Netlify dashboard.
  3. Choose Your Git Provider:

    • Select your Git provider where your website’s code is hosted (e.g., GitHub, GitLab, Bitbucket).
  4. Authorize Netlify:

    • Follow the prompts to authorize Netlify to access your repository.
  5. Pick a Repository:

    • Choose the repository that contains your static website’s code.
  6. Configure Your Settings:

    • Configure your settings:
      • Branch to Deploy: Specify the branch you want to deploy (usually, it’s the main or master branch).
      • Build Command: Enter the build command, which is often as simple as npm run build or yarn build.
      • Publish Directory: Specify the directory where your built website files are located. This is typically the dist or public folder.
    • Once you’ve configured your settings, click “Deploy Site.”
  7. Deployment Progress:

    • Netlify will now build and deploy your website. You can view the deployment progress in real-time on your Netlify dashboard.
  8. Site Published:

    • After a successful deployment, your site will be published, and you’ll receive a unique URL (usually in the format https://yoursitename.netlify.app).
ADVERTISEMENT

Configure Domain (Optional)

If you have your own custom domain, you can easily configure it with your Netlify-hosted site.

  1. Go to Domain Settings:

    • In your Netlify dashboard, navigate to the “Domain Settings” for your site.
  2. Add Custom Domain:

    • Click “Add custom domain” and follow the prompts to add your domain.
  3. DNS Configuration:

    • Configure your domain’s DNS settings to point to Netlify. This may vary depending on your domain registrar, but Netlify provides clear instructions for this step.
  4. SSL Certificate:

    • Netlify will automatically provide SSL certificates for your custom domain, ensuring a secure connection.

Access Your Website

Your static website is now live on Netlify, and you can access it using the unique URL provided. This URL is where your website will be hosted, and it’s accessible to anyone.

That’s it! Netlify is a powerful and user-friendly platform for hosting static websites. It offers various features, including continuous deployment, automatic HTTPS, and excellent scalability. You can now share your website with the world, and any updates you make to your repository will automatically reflect on your hosted site.

Netlify makes hosting static websites a breeze, allowing you to focus on your content and projects rather than the complexities of web hosting. Enjoy the benefits of fast and reliable hosting for your static websites with Netlify.

ADVERTISEMENT

The post Hosting Your Static Website on Netlify: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Hosting Your Static Website on GitHub Pages for Free: A Step-by-Step Guide https://www.learnwebstack.com/hosting-your-static-website-on-github-pages-for-free-a-step-by-step-guide/ Tue, 07 Nov 2023 12:49:42 +0000 https://www.learnwebstack.com/?p=5334 GitHub Pages allows you to easily host and share your HTML, CSS, and JavaScript-based websites with the world for free. In this step-by-step article, we'll walk you through the process of hosting your static website on GitHub Pages.

The post Hosting Your Static Website on GitHub Pages for Free: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Photo by Danny Meneses

If you have a static website and you’re looking for a hassle-free way to host it for free, GitHub Pages is an excellent choice. GitHub Pages allows you to easily host and share your HTML, CSS, and JavaScript-based websites with the world. In this step-by-step guide, we’ll walk you through the process of hosting your static website on GitHub Pages

Prepare Your Website

Before you begin, make sure your static website is ready. Ensure that it contains all the necessary HTML, CSS, JavaScript, and other assets (images, fonts, etc.). Here’s a quick checklist:

  • HTML files for your webpages.
  • CSS files for styling.
  • JavaScript files for interactivity (if needed).
  • Any additional assets like images or fonts.
ADVERTISEMENT

Create a GitHub Repository

To host your website on GitHub Pages, you’ll need a GitHub account. If you don’t have one, sign up at GitHub.

  1. Log in to GitHub: If you’re not already logged in, log in to your GitHub account.

  2. Create a New Repository:

    • Click on the ‘+’ sign in the top right corner of the GitHub dashboard and select “New Repository.”
    • Choose a name for your repository. The repository name should be in the format yourusername.github.io, where yourusername is your GitHub username. This naming convention is crucial for GitHub Pages to work.
    • Provide a short description (optional).
    • Choose the repository visibility. If you want to keep your website public, select “Public.” If you prefer it to be private (which is not recommended for hosting a public website), you can choose “Private.”
  3. Initialize with a README:

    • It’s a good practice to initialize your repository with a README. This file can contain information about your website or project.
    • You can also choose a license for your project. If you’re unsure, you can select an open-source license like MIT.
  4. Create Repository:

    • Click the “Create repository” button.
ADVERTISEMENT

Upload Your Website Files

With your repository created, it’s time to add your website files.

  1. Upload Files:

    • Click on the “Add file” button and select “Upload files.”
  2. Drag and Drop:

    • You can drag and drop your website files or click the “choose your files” link to upload them.
  3. Commit Changes:

    • After adding your files, scroll down, and you’ll see an area to commit your changes. You can provide a brief description of the changes you made (e.g., “Initial website upload”).
    • Click the “Commit changes” button.
ADVERTISEMENT

Configure GitHub Pages

Now that your website files are in your repository, let’s configure GitHub Pages to publish them.

  1. Go to Repository Settings:

    • In your repository, click the “Settings” tab at the top.
  2. Scroll Down to the Code and automation Section:

    • Scroll down to the Code and automation section in the left navigation bar and select “Pages”. Here, you can see the source for your GitHub Pages site.
  3. Choose a Branch:

    • By default, the source is set to the main branch. If your website’s HTML file is named something other than index.html, you can specify the correct filename here.
    • Once you’ve configured this, click “Save.”
ADVERTISEMENT

Access Your Website

Your website is now live on GitHub Pages! You can access it using the URL in the GitHub Pages section of your repository settings. It will be in the format https://yourusername.github.io.

That’s it! Your static website is now hosted on GitHub Pages and accessible to anyone with the URL. You can continue to make changes to your website by updating your GitHub repository, and the changes will be reflected on your hosted site.

GitHub Pages is an excellent and free option for hosting static websites, portfolios, blogs, and more. It’s simple to set up and provides reliable hosting for your projects. So, go ahead and share your creations with the world!

The post Hosting Your Static Website on GitHub Pages for Free: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Crafting a Stylish Responsive Random Quote Generator with HTML, CSS, and JavaScript https://www.learnwebstack.com/crafting-a-stylish-responsive-random-quote-generator-with-html-css-and-javascript/ Sat, 28 Oct 2023 12:30:01 +0000 https://www.learnwebstack.com/?p=5068 This beginner-friendly article will walk you through the process of creating a visually appealing Random Quote Generator using HTML, CSS, and JavaScript.

The post Crafting a Stylish Responsive Random Quote Generator with HTML, CSS, and JavaScript first appeared on LearnWebstack.com.

]]>
Photo by Yathin Babu

In the world of web development, a Random Quote Generator is not just a fun project—it’s a source of inspiration and wisdom. Whether you’re building it for personal motivation or as a delightful feature for your website, this beginner-friendly guide will walk you through the process of creating a visually appealing Random Quote Generator using HTML, CSS, and JavaScript.

Setting Up the HTML Structure

Let’s begin by creating the basic HTML structure for our Random Quote Generator. We’ll have a container for the generator, a display area for quotes, and a button to trigger the randomness.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Random Quote Generator</title>
</head>
<body>
    <div class="generator">
        <div class="quote" id="quote">
            "Your random quote will appear here."
        </div>
        <button id="generate">Generate Quote</button>
    </div>
    <script src="script.js"></script>
</body>
</html>

This HTML structure lays the foundation for our Random Quote Generator, including a quote display area and a button to generate quotes.

ADVERTISEMENT

Styling with CSS

To make our Random Quote Generator visually appealing, we’ll add some CSS styles. Create a style.css file and apply the following styles:

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.generator {
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    width: 300px;
    text-align: center;
    padding: 20px;
}

.quote {
    font-size: 18px;
    margin-bottom: 20px;
}

button {
    border: none;
    background-color: #007BFF;
    color: #fff;
    font-size: 16px;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
}

button:hover {
    background-color: #0056b3;
}

These CSS styles give our Random Quote Generator a modern and clean appearance, ensuring it’s visually appealing.

ADVERTISEMENT

Adding JavaScript Functionality

Now, let’s infuse our Random Quote Generator with JavaScript functionality. Create a script.js file and include the following code:

// Select elements from the DOM
const quoteDisplay = document.getElementById("quote");
const generateButton = document.getElementById("generate");

// Array of random quotes
const quotes = [
    "The only limit to our realization of tomorrow will be our doubts of today. – Franklin D. Roosevelt",
    "The best way to predict the future is to create it. – Peter Drucker",
    "In the middle of every difficulty lies opportunity. – Albert Einstein",
    "Don’t watch the clock; do what it does. Keep going. – Sam Levenson",
    "You are never too old to set another goal or to dream a new dream. – C.S. Lewis",
    "The secret of getting ahead is getting started. – Mark Twain",
    // Add more quotes here
];

// Function to generate a random quote
function generateRandomQuote() {
    const randomIndex = Math.floor(Math.random() * quotes.length);
    quoteDisplay.textContent = quotes[randomIndex];
}

// Add event listener to the generate button
generateButton.addEventListener("click", generateRandomQuote);

// Generate an initial quote
generateRandomQuote();

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

ADVERTISEMENT

Making it Responsive

To ensure our Random Quote Generator is responsive, we can use media queries in our style.css file to adjust the layout for different screen sizes. Here’s an example of how you can do this:

/* Small screens (mobile) */
@media (max-width: 600px) {
    .generator {
        width: 80%;
    }
}

/* Medium screens (tablets) */
@media (min-width: 601px) and (max-width: 1024px) {
    .generator {
        width: 60%;
    }
}

/* Large screens (desktop) */
@media (min-width: 1025px) {
    .generator {
        width: 400px;
    }
}

These media queries adapt the layout of the generator for small screens (mobile), medium screens (tablets), and large screens (desktop).

Click here to get the complete source code.

Here is an article on how to host this app online using GitHub.

ADVERTISEMENT

The post Crafting a Stylish Responsive Random Quote Generator with HTML, CSS, and JavaScript first appeared on LearnWebstack.com.

]]>
Crafting a Sleek Responsive To-Do List App with HTML, CSS, and JavaScript https://www.learnwebstack.com/crafting-a-sleek-responsive-to-do-list-app-with-html-css-and-javascript/ Sat, 28 Oct 2023 12:02:41 +0000 https://www.learnwebstack.com/?p=5057 Whether you're building this for personal use or as part of a larger project, this beginner-friendly article will take you through the process of creating a visually appealing To-Do List App using HTML, CSS, and JavaScript.

The post Crafting a Sleek Responsive To-Do List App with HTML, CSS, and JavaScript first appeared on LearnWebstack.com.

]]>
Photo by Yathin Babu

In the fast-paced world we live in, staying organized is a challenge we all face. That’s where a stylish and responsive To-Do List App can come to the rescue. Whether you’re building this for personal use or as part of a larger project, this beginner-friendly article will take you through the process of creating a visually appealing To-Do List App using HTML, CSS, and JavaScript.

Setting Up the HTML Structure

Let’s kick things off by creating the basic HTML structure for our To-Do List App. We’ll have a container for the app, a section for adding tasks, a list to display tasks, and buttons for actions.

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>To-Do List App</title>
</head>
<body>
    <div class="app">
        <div class="add-task">
            <input type="text" id="task" placeholder="Add a task...">
            <button id="add">Add</button>
        </div>
        <ul id="task-list"></ul>
        <div class="actions">
            <button id="clear">Clear Completed</button>
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>

This HTML structure includes input fields for adding tasks, a list to display tasks, and buttons for actions like adding and clearing tasks.

ADVERTISEMENT

Styling with CSS

To make our To-Do List App visually appealing, let’s add some CSS styles. Create a style.css file and apply the following styles:

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.app {
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    width: 300px;
}

.add-task {
    padding: 10px;
    display: flex;
    border-bottom: 1px solid #ccc;
}

input {
    border: none;
    background: none;
    width: 100%;
    font-size: 14px;
    padding: 10px;
}

button {
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
}

#task-list {
    list-style: none;
    padding: 0;
}

li {
    border-bottom: 1px solid #ccc;
    padding: 10px;
    display: flex;
    justify-content: space-between;
}

.actions {
    padding: 10px;
    text-align: center;
}

These CSS styles give our To-Do List App a modern and clean appearance, ensuring it’s visually appealing.

ADVERTISEMENT

Adding JavaScript Functionality

Now, let’s add JavaScript functionality to our To-Do List App. Create a script.js file and include the following code:

// Select elements from the DOM
const taskInput = document.getElementById("task");
const addTaskButton = document.getElementById("add");
const taskList = document.getElementById("task-list");
const clearButton = document.getElementById("clear");

// Function to add a new task
function addTask() {
    const taskText = taskInput.value.trim();
    if (taskText === "") return;

    const taskItem = document.createElement("li");
    taskItem.innerHTML = `
        ${taskText}
        <button class="delete">Delete</button>
    `;

    taskList.appendChild(taskItem);
    taskInput.value = "";

    // Add an event listener for deleting tasks
    const deleteButton = taskItem.querySelector(".delete");
    deleteButton.addEventListener("click", () => {
        taskList.removeChild(taskItem);
    });
}

// Function to clear completed tasks
function clearCompletedTasks() {
    const completedTasks = taskList.querySelectorAll("li");
    completedTasks.forEach(task => {
        if (task.querySelector("button.delete")) {
            taskList.removeChild(task);
        }
    });
}

// Add event listeners
addTaskButton.addEventListener("click", addTask);
taskInput.addEventListener("keyup", (event) => {
    if (event.key === "Enter") {
        addTask();
    }
});
clearButton.addEventListener("click", clearCompletedTasks);

This JavaScript code adds functionality to our To-Do List App. Users can input tasks, mark them as complete, and clear completed tasks.

ADVERTISEMENT

Making it Responsive

To ensure our To-Do List App is responsive, we can use media queries in our styles.css file to adjust the layout for different screen sizes. Here’s an example of how you can do this:

/* Small screens (mobile) */
@media (max-width: 600px) {
    .app {
        width: 80%;
    }
}

/* Medium screens (tablets) */
@media (min-width: 601px) and (max-width: 1024px) {
    .app {
        width: 60%;
    }
}

/* Large screens (desktop) */
@media (min-width: 1025px) {
    .app {
        width: 400px;
    }
}

These media queries adapt the layout of the app for small screens (mobile), medium screens (tablets), and large screens (desktop).

Click here to get the complete source code.

Here is an article on how to host this app online using GitHub.

ADVERTISEMENT

The post Crafting a Sleek Responsive To-Do List App with HTML, CSS, and JavaScript first appeared on LearnWebstack.com.

]]>
Building a Responsive Calculator with HTML, CSS, and JavaScript https://www.learnwebstack.com/building-a-responsive-calculator-with-html-css-and-javascript/ Sat, 28 Oct 2023 11:36:53 +0000 https://www.learnwebstack.com/?p=5050 In this step-by-step article, we'll walk you through the process of building a good-looking and responsive calculator that can perform basic operations like addition, subtraction, multiplication, and division.

The post Building a Responsive Calculator with HTML, CSS, and JavaScript first appeared on LearnWebstack.com.

]]>
Photo by Yathin Babu

In the world of web development, creating a sleek and responsive calculator is a great way to practice your HTML, CSS, and JavaScript skills. Not only will it enhance your understanding of these technologies, but it will also result in a handy tool that you can use for everyday calculations. In this step-by-step guide, we’ll walk you through the process of building a good-looking and responsive calculator that can perform basic operations like addition, subtraction, multiplication, and division.

Setting up the HTML Structure

Let’s start by creating the basic HTML structure for our calculator. We’ll have a container for the calculator, a display for input and results, and buttons for numbers and operations.

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Responsive Calculator</title>
</head>
<body>
    <div class="calculator">
        <div class="display">
            <input type="text" id="result" value="0" readonly>
        </div>
        <div class="buttons">
            <!-- Buttons will be added here using JavaScript -->
        </div>
    </div>
    <script src="script.js"></script>
</body>
</html>

In this section, we’ve set up the basic HTML structure, including an input field for the display. The buttons for the calculator will be dynamically added using JavaScript.

ADVERTISEMENT

Styling the Calculator with CSS

Now, let’s make our calculator visually appealing by adding some CSS styles. Create a style.css file and apply the following styles. We’ll make it responsive, so it looks great on both desktop and mobile devices.

CSS:

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.calculator {
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    width: 300px;
}

.display {
    background-color: #333;
    color: #fff;
    padding: 10px;
    text-align: right;
}

input {
    border: none;
    background: none;
    width: 100%;
    font-size: 24px;
    color: #fff;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

button {
    border: none;
    background: none;
    font-size: 24px;
    padding: 10px;
    cursor: pointer;
}

These CSS styles provide a clean and modern appearance to our calculator, making it visually appealing.

ADVERTISEMENT

Adding Functionality with JavaScript

Now, it’s time to add the JavaScript functionality to our calculator. Create a script.js file and include the following code.

JS:

// Select the display input field
const display = document.getElementById("result");

// Function to update the display
function updateDisplay(value) {
    display.value = value;
}

// Function to create buttons
function createButton(label) {
    const button = document.createElement("button");
    button.textContent = label;
    return button;
}

// Add event listeners to buttons
const buttonContainer = document.querySelector(".buttons");

const buttonLabels = [
    "7", "8", "9", "/",
    "4", "5", "6", "*",
    "1", "2", "3", "-",
    "0", "C", "=", "+"
];

buttonLabels.forEach(label => {
    const button = createButton(label);
    button.addEventListener("click", () => {
        if (label === "=") {
            try {
                updateDisplay(eval(display.value));
            } catch (error) {
                updateDisplay("Error");
            }
        } else if (label === "C") {
            updateDisplay("0");
        } else {
            if (display.value === "0") {
                updateDisplay(label);
            } else {
                updateDisplay(display.value + label);
            }
        }
    });

    buttonContainer.appendChild(button);
});

This JavaScript code adds functionality to our calculator. It allows users to input numbers and perform basic operations like addition, subtraction, multiplication, and division.

ADVERTISEMENT

Making it Responsive

To make our calculator responsive, we can use media queries in our style.css file to adjust the layout for different screen sizes.

CSS:

/* Small screens (mobile) */
@media (max-width: 600px) {
    .calculator {
        width: 80%;
    }
}

/* Medium screens (tablets) */
@media (min-width: 601px) and (max-width: 1024px) {
    .calculator {
        width: 60%;
    }
}

/* Large screens (desktop) */
@media (min-width: 1025px) {
    .calculator {
        width: 400px;
    }
}

These media queries will adapt the calculator’s layout for small screens (mobile), medium screens (tablets), and large screens (desktop).

Conclusion

Congratulations! You’ve successfully built a responsive and good-looking calculator using HTML, CSS, and JavaScript. This project allows you to apply various JavaScript concepts like event handling, DOM manipulation, and conditional statements in a practical way. Whether you’re a beginner or an experienced developer, creating such projects is a great way to sharpen your coding skills and have a handy tool at your disposal.

Feel free to enhance your calculator by adding more features like percentage calculations or scientific functions. The possibilities are endless, and it’s a fantastic way to keep improving your web development skills. Happy coding!

Click here to get the complete source code.

Here is an article on how to host this app online using GitHub.

ADVERTISEMENT

The post Building a Responsive Calculator with HTML, CSS, and JavaScript first appeared on LearnWebstack.com.

]]>
Crafting a Blog Archive Page: A Beginner’s Guide https://www.learnwebstack.com/crafting-a-blog-archive-page-a-beginners-guide/ Sat, 14 Oct 2023 08:42:16 +0000 https://www.learnwebstack.com/?p=4468 In the vast landscape of the internet, creating a simple yet effective blog archive page is a valuable asset for bloggers and content creators. In this beginner-friendly guide, we'll walk through the process of crafting a sleek blog archive page using HTML and CSS.

The post Crafting a Blog Archive Page: A Beginner’s Guide first appeared on LearnWebstack.com.

]]>
Photo by Canva Studio

In the vast landscape of the internet, creating a simple yet effective blog archive page is a valuable asset for bloggers and content creators. In this beginner-friendly guide, we’ll walk through the process of crafting a sleek blog archive page using HTML and CSS. This archive will feature a header with a captivating title and image, a call-to-action (CTA) section with a subscription form, and a footer for a polished finish.

The Header - Welcoming Your Audience

The header is the first impression your readers will have of your blog archive page. Let’s start strong with an enticing title and an inviting image.

HTML:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Blog Archive Page</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
    <header>
        <h1>Welcome to Our Blog Archive</h1>
        <img src="archive-header-image.jpg" alt="Blog Archive Image">
    </header>
</body>
</html>

CSS (style.css):

/* Header styles */
header {
    text-align: center;
    background-color: #007BFF;
    color: #fff;
    padding: 60px;
}

header h1 {
    font-size: 36px;
}

header img {
    width: 300px;
    height: auto;
    margin-top: 20px;
}

In the header section, we’ve employed a captivating title and an engaging image to set the tone for the blog archive.

ADVERTISEMENT

Blog Articles - The Heart of Your Archive

The main content of your blog archive page is the list of blog articles. We’ll create a simple blog article card structure to showcase your content.

HTML:

<section class="blog-archive">
    <div class="blog-card">
        <img src="blog-image-1.jpg" alt="Blog 1 Image">
        <h3>Blog Title 1</h3>
        <p>Published on: Date 1</p>
        <a href="blog-1.html">Read More</a>
    </div>
    <!-- Repeat this structure for Blog 2 and Blog 3 -->
</section>

CSS (style.css):

/* Blog archive styles */
.blog-archive {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 20px;
}

.blog-card {
    text-align: center;
    max-width: 300px;
    margin: 20px;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.blog-card img {
    width: 100%;
    height: auto;
    margin-top: 10px;
}

.blog-card h3 {
    font-size: 20px;
    margin: 10px 0;
}

.blog-card p {
    color: #777;
    margin: 5px 0;
}

.blog-card a {
    color: #007BFF;
    text-decoration: none;
    display: block;
    margin-top: 10px;
}

.blog-card a:hover {
    text-decoration: underline;
}

The blog archive section features individual blog cards with images, titles, publication dates, and “Read More” links. The use of flexbox ensures that these cards arrange themselves neatly on various screen sizes.

ADVERTISEMENT

Call-to-Action (CTA) - Engaging with Your Readers

The CTA section is where you can encourage readers to subscribe to your blog. We’ll include a simple subscription form to make it easy for them to stay updated.

HTML:

<section class="cta">
    <h2>Stay In the Loop</h2>
    <form>
        <label for="name">Name:</label>
        <input type="text" id="name" name="name" required>
        <label for="email">Email:</label>
        <input type="email" id="email" name="email" required>
        <input type="submit" value="Subscribe">
    </form>
</section>

CSS (style.css):

/* CTA section styles */
.cta {
    text-align: center;
    background-color: #007BFF;
    color: #fff;
    padding: 40px;
}

/* Form styles */
form {
    display: flex;
    flex-direction: column;
    max-width: 300px;
    margin: 0 auto;
}

label {
    font-weight: bold;
    margin-bottom: 10px;
}

input {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

In this section, we’ve included a clear message and a user-friendly subscription form to help readers stay updated with your blog.

ADVERTISEMENT

Wrapping it up with a Footer

The footer is the finishing touch, providing important information about your blog.

HTML:

<footer>
    <p>&copy; 2023 Your Blog. All rights reserved.</p>
</footer>
</html>

CSS (style.css):

/* Footer styles */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
}

The footer displays a copyright notice and maintains the overall design theme.

ADVERTISEMENT

To upload your image and host your website on GitHub Pages, follow these steps:

  1. Create a GitHub account if you don’t have one.
  2. Create a new GitHub repository and name it something like “your-username.github.io,” where “your-username” is your GitHub username.
  3. Now, you’ll be on the repository page. Click on the “Add file” button, then select “Upload files.”
  4. You can either drag and drop your image files into the designated area or click on “choose your files” to browse for the image on your computer.
  5. Once you’ve selected your image files, scroll down to the “Commit changes” section. You can add a brief description of your commit if you like. Click the “Commit changes” button to upload your images.
  6. After committing the changes, your image files will be uploaded to your repository.
  7. To get the URL of your image, click on the image file you want to use. You’ll see your image displayed on a page. Right-click on the image and select “Copy image address” or “Copy image location” (the exact option may vary depending on your web browser). Now, you can use this URL to display the image in your HTML article.
  8. Commit your HTML and CSS files to the repository.
  9. Go to the “Settings” tab of your repository.
  10. Under the “GitHub Pages” section, set the source branch to “main” (or “master”).
  11. Your website should now be accessible at “https://your-username.github.io.”
ADVERTISEMENT

With these HTML and CSS elements, you can create a captivating and functional blog archive page that showcases your content and invites readers to engage. Make sure to optimize your page for mobile devices and follow SEO best practices to enhance your blog’s discoverability in search engines. Happy blogging!

Click here to get the complete source code.

The post Crafting a Blog Archive Page: A Beginner’s Guide first appeared on LearnWebstack.com.

]]>
Creating a Simple Product Landing Page: A Step-by-Step Guide https://www.learnwebstack.com/creating-a-simple-product-landing-page-a-step-by-step-guide/ Wed, 11 Oct 2023 12:10:36 +0000 https://www.learnwebstack.com/?p=4444 In today's digital age, a compelling product landing page is crucial for showcasing your product and attracting potential customers. In this step-by-step guide, we'll walk you through the process of creating an eye-catching and effective product landing page using HTML and CSS.

The post Creating a Simple Product Landing Page: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Photo by Danny Meneses

In today’s digital age, a compelling product landing page is crucial for showcasing your product and attracting potential customers. In this step-by-step guide, we’ll walk you through the process of creating an eye-catching and effective product landing page using HTML and CSS. This page will feature a header, benefits section, features section, reviews, a call-to-action (CTA), and a footer.

ADVERTISEMENT

The Header - Making the First Impression

The header is the first thing visitors see, so let’s make it impactful. We’ll include a catchy title and an enticing product image.

HTML:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome to Our Amazing Product!</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
    <header>
        <h1>Welcome to Our Amazing Product!</h1>
        <img src="product-image.jpg" alt="Product Image">
    </header>
</body>
</html>

CSS (style.css):

/* Header styles */
header {
    text-align: center;
    background-color: #007BFF;
    color: #fff;
    padding: 60px;
}

header h1 {
    font-size: 36px;
}

header img {
    width: 300px;
    height: auto;
    margin-top: 20px;
}

In the header section, we’ve used a bold title and an appealing product image, along with styling for improved aesthetics.

Highlighting the Benefits

The benefits section is where you can showcase what your product offers. We’ll use icon-text boxes to make this information stand out.

HTML:

<section class="benefits">
    <div class="benefit">
        <img src="benefit-icon-1.png" alt="Icon 1">
        <h2>Benefit 1</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
    </div>
    <!-- Repeat this structure for Benefit 2 and Benefit 3 -->
</section>

CSS (style.css):

/* Benefits section styles */
.benefits {
    display: flex;
    justify-content: space-around;
    padding: 40px;
}

.benefit {
    text-align: center;
    max-width: 300px;
}

In this section, we’ve used flexbox to arrange the benefit boxes in a row, each containing an icon, a title, and a description.

ADVERTISEMENT

Showcasing Features

The features section provides an overview of your product’s capabilities using bullet points.

HTML:

<section class="features">
    <ul>
        <li>Feature 1</li>
        <li>Feature 2</li>
        <!-- Repeat this structure for all 10 features -->
    </ul>
</section>

CSS (style.css):

/* Features section styles */
.features {
    padding: 40px;
}

.features ul {
    list-style-type: disc;
    margin-left: 20px;
}

Here, we’ve created an unordered list to display the product’s features in a clear and concise manner.

Building Trust with Reviews

Reviews from satisfied customers can boost your product’s credibility. Let’s use review cards to showcase them.

HTML:

<section class="reviews">
    <div class="review-card">
        <img src="reviewer-image-1.jpg" alt="Reviewer 1">
        <h3>Reviewer 1</h3>
        <p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit."</p>
    </div>
    <!-- Repeat this structure for Reviewer 2 and Reviewer 3 -->
</section>

CSS (style.css):

/* Review section styles */
.reviews {
    display: flex;
    justify-content: space-around;
    padding: 40px;
}

.review-card {
    text-align: center;
    max-width: 300px;
}

This section features review cards with reviewer images, names, and their feedback, displayed in a visually appealing layout.

ADVERTISEMENT

Encouraging Action with a CTA

A call-to-action section with a form allows visitors to get in touch with you or take the next step.

HTML:

<section class="cta">
    <h2>Ready to Try Our Product?</h2>
    <form>
        <label for="name">Name:</label>
        <input type="text" id="name" name="name" required>
        <label for="email">Email:</label>
        <input type="email" id="email" name="email" required>
        <input type="submit" value="Get Started">
    </form>
</section>

CSS (style.css):

/* CTA section styles */
.cta {
    text-align: center;
    background-color: #007BFF;
    color: #fff;
    padding: 40px;
}

/* Form styles */
form {
    display: flex;
    flex-direction: column;
    max-width: 300px;
    margin: 0 auto;
}

label {
    font-weight: bold;
    margin-bottom: 10px;
}

input {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

The CTA section includes a clear message and a form for visitors to input their name and email.

Wrapping it up with a Footer

A well-designed footer completes your landing page.

HTML:

<footer>
    <p>&copy; 2023 Your Company. All rights reserved.</p>
</footer>
</html>

CSS (style.css):

/* Footer styles */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
}

The footer displays a copyright notice and maintains the overall design theme.

ADVERTISEMENT

Responsiveness

To make the benefits and reviews sections responsive and visually appealing on various screen sizes, you can use media queries in your CSS. Here’s how to add responsive styles for the benefits and reviews sections

CSS (style.css):

/* CTA section styles */
.cta {
    text-align: center;
    background-color: #007BFF;
    color: #fff;
    padding: 40px;
}

/* Form styles */
form {
    display: flex;
    flex-direction: column;
    max-width: 300px;
    margin: 0 auto;
}

label {
    font-weight: bold;
    margin-bottom: 10px;
}

input {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

With these HTML and CSS elements, you can create an attractive and effective product landing page that captures the essence of your product and encourages visitors to take action. Remember to optimize your page for mobile devices and implement SEO best practices for improved visibility in search engines. Good luck with your project!

ADVERTISEMENT

To upload your image and host your website on GitHub Pages, follow these steps:

  1. Create a GitHub account if you don’t have one.
  2. Create a new GitHub repository and name it something like “your-username.github.io,” where “your-username” is your GitHub username.
  3. Now, you’ll be on the repository page. Click on the “Add file” button, then select “Upload files.”
  4. You can either drag and drop your image files into the designated area or click on “choose your files” to browse for the image on your computer.
  5. Once you’ve selected your image files, scroll down to the “Commit changes” section. You can add a brief description of your commit if you like. Click the “Commit changes” button to upload your images.
  6. After committing the changes, your image files will be uploaded to your repository.
  7. To get the URL of your image, click on the image file you want to use. You’ll see your image displayed on a page. Right-click on the image and select “Copy image address” or “Copy image location” (the exact option may vary depending on your web browser). Now, you can use this URL to display the image in your HTML article.
  8. Commit your HTML and CSS files to the repository.
  9. Go to the “Settings” tab of your repository.
  10. Under the “GitHub Pages” section, set the source branch to “main” (or “master”).
  11. Your website should now be accessible at “https://your-username.github.io.”
ADVERTISEMENT

Click here to get the complete source code.

The post Creating a Simple Product Landing Page: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Building Your Own Portfolio Website: A Step-by-Step Guide https://www.learnwebstack.com/building-your-own-portfolio-website-a-step-by-step-guide/ Tue, 26 Sep 2023 11:51:44 +0000 https://www.learnwebstack.com/?p=3989 In this article, we will walk you through the process of creating a simple portfolio website using HTML and CSS, and then we'll show you how to host it for free on GitHub Pages.

The post Building Your Own Portfolio Website: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>
Photo by Markus Winkler

In today’s digital age, having a personal portfolio website is a powerful tool for showcasing your skills, projects, and achievements to the world. In this article, we will walk through the process of creating a simple portfolio website using HTML and CSS, and then we’ll learn how to host it for free on GitHub Pages. This website will have a header section, a Skills section, a Projects section, an Education section, a Contact Me section, and a footer. Let’s get started!

Setting Up the Basic Structure

First, let’s create the basic structure of your portfolio website using HTML. We’ll start with the header section, which will include your name and a profile picture.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css"> <!-- We'll create this file later for CSS styling -->
    <title>Your Portfolio</title>
</head>
<body>
    <header>
        <h1>Your Name</h1>
        <img src="your-image.jpg" alt="Your Name">
    </header>
    <!-- Add other sections here -->
    <footer>
        &copy; 2023 Your Portfolio
    </footer>
</body>
</html>

Replace "your-image.jpg" with the filename of your profile picture. We’ll cover how to upload this image to GitHub later.

ADVERTISEMENT

Adding Your Skills

In the Skills section, you can list your skills using an unordered list.

<section>
    <h2>Skills</h2>
    <ul>
        <li>HTML</li>
        <li>CSS</li>
        <li>JavaScript</li>
        <!-- Add more skills as needed -->
    </ul>
</section>

Showcasing Your Projects

Next, create an ordered list to display your projects in the Projects section.

<section>
    <h2>Projects</h2>
    <ol>
        <li>Portfolio Website</li>
        <li>E-commerce App</li>
        <li>Blog Website</li>
        <!-- Add your projects here -->
    </ol>
</section>

Highlighting Your Education

Use an HTML table to present your education details in a structured way.

<section>
    <h2>Education</h2>
    <table>
        <tr>
            <th>Qualification</th>
            <th>Institution</th>
            <th>Year</th>
        </tr>
        <tr>
            <td>Bachelor's Degree</td>
            <td>Your University</td>
            <td>20XX</td>
        </tr>
        <tr>
            <td>Master's Degree</td>
            <td>Your University</td>
            <td>20XX</td>
        </tr>
        <!-- Add more rows for additional education details -->
    </table>
</section>

Contact Me

To allow visitors to get in touch with you, create a Contact Me section with a form.

<section>
    <h2>Contact Me</h2>
    <form action="https://formspree.io/your-email" method="POST">
        <label for="name">Name:</label>
        <input type="text" id="name" name="name" required>
        
        <label for="email">Email:</label>
        <input type="email" id="email" name="email" required>
        
        <label for="message">Message:</label>
        <textarea id="message" name="message" required></textarea>
        
        <input type="submit" value="Submit">
    </form>
</section>

Replace "https://formspree.io/your-email" with the URL provided by Formspree, a service that allows you to receive form submissions via email.

ADVERTISEMENT

Styling Your Portfolio Website with CSS

To make your portfolio website visually appealing, you’ll need to apply styles using CSS (Cascading Style Sheets). Let’s create a separate CSS file and link it to your HTML document.

  1. Create a CSS file: Create a new file named “style.css” in the same directory as your HTML file.

  2. Link the CSS file to your HTML: In the <head> section of your HTML document, add the following line to link the CSS file:

<link rel="stylesheet" href="styles.css">
  1. Add CSS styles: In the “style.css” file, you can define styles for various elements. Here’s an example of how to style the header section:
/* Add a background color and adjust padding for the header */
header {
    background-color: #007BFF;
    color: #fff;
    text-align: center;
    padding: 40px 0;
}

/* Style the header text */
header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

/* Style the profile image */
header img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #fff;
}

/* Style the navigation menu */
nav ul {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}

nav li {
    display: inline;
    margin-right: 20px;
}

/* Add hover effect to navigation links */
nav a:hover {
    text-decoration: underline;
}

/* Style the sections with a subtle background color and padding */
section {
    background-color: #f9f9f9;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

/* Style the section headings */
section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

/* Style the project list with icons */
ul.projects {
    list-style-type: none;
    padding-left: 0;
}

ul.projects li {
    margin-bottom: 10px;
    position: relative;
}

ul.projects li::before {
    content: "\2022"; /* Bullet character */
    color: #007BFF; /* Bullet color */
    font-size: 16px;
    position: absolute;
    left: -20px;
    top: 6px;
}

/* Style the table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

/* Style table headers */
th {
    background-color: #007BFF;
    color: #fff;
    font-weight: bold;
    padding: 10px;
    text-align: left;
}

/* Style table data cells */
td {
    padding: 10px;
    border: 1px solid #ddd;
}

/* Add zebra striping to table rows for better readability */
tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Style form labels */
form label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

/* Style text input fields */
form input[type="text"],
form input[type="email"],
form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* Style the submit button */
form input[type="submit"] {
    background-color: #007BFF;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form input[type="submit"]:hover {
    background-color: #0056b3;
}

/* Style the footer */
footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

/* Style links in the footer */
footer a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
}

footer a:hover {
    text-decoration: underline;
}

This CSS code sets the background color, text color, font size, and styles the profile picture within the header section.

  1. Continue styling: You can apply styles to other sections, lists, tables, and form elements as needed. Use CSS to customize fonts, colors, margins, padding, and more to create a cohesive and visually appealing design for your portfolio.

Remember that CSS offers a wide range of styling options, so you can get creative with how you want your portfolio to look. Don’t forget to preview your website in a web browser to see how the styles are applied and make adjustments as necessary.

By following these steps, you’ll be able to style your portfolio website and make it uniquely yours.

ADVERTISEMENT

Finally, in the footer, provide copyright information and a link to your GitHub repository where you will host your portfolio website.

To upload your image and host your website on GitHub Pages, follow these steps:

  1. Create a GitHub account if you don’t have one.
  2. Create a new GitHub repository and name it something like “your-username.github.io,” where “your-username” is your GitHub username.
  3. Now, you’ll be on the repository page. Click on the “Add file” button, then select “Upload files.”
  4. You can either drag and drop your image files into the designated area or click on “choose your files” to browse for the image on your computer.
  5. Once you’ve selected your image files, scroll down to the “Commit changes” section. You can add a brief description of your commit if you like. Click the “Commit changes” button to upload your images.
  6. After committing the changes, your image files will be uploaded to your repository.
  7. To get the URL of your image, click on the image file you want to use. You’ll see your image displayed on a page. Right-click on the image and select “Copy image address” or “Copy image location” (the exact option may vary depending on your web browser). Now, you can use this URL to display the image in your HTML article.
  8. Commit your HTML and CSS files to the repository.
  9. Go to the “Settings” tab of your repository.
  10. Under the “GitHub Pages” section, set the source branch to “main” (or “master”).
  11. Your website should now be accessible at “https://your-username.github.io.”

That’s it! You’ve created a simple portfolio website using HTML and CSS and hosted it on GitHub Pages. Now, you can customize the website’s styling using CSS and continually update your portfolio to showcase your latest work and skills. Good luck with your portfolio!

ADVERTISEMENT

Click here to get the complete source code.

The post Building Your Own Portfolio Website: A Step-by-Step Guide first appeared on LearnWebstack.com.

]]>