Various formatting options on GitHub Pages

As a beginner in programming, I recently deployed my first project to github pages. However, I am facing two issues:

  1. While the desktop version of the site looks perfect, the cards on the home page appear unseparated on mobile and iPad devices. Despite trying to add margin and other adjustments, the issue persists.
  2. I have heard about organizing files into folders like Css, image, JS, etc., when uploading them to a server. But I'm confused about placing HTML pages (excluding index) in a "static" directory while leaving the index on the root directory. Can someone explain the reason for this?

You can view my github site here:

Below is the HTML code for the index page:

 <!-- Home page -->
      .grid-container {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: min-content;
        justify-content: space-between;
        grid-template-areas:
          "hd"
          "feat"
          "main"
          "ft";
      }
    
      .menu {
        list-style-type: none;
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
      }
    
      .featured-post {
        grid-area: feat;
        padding: 0 20px;
        border-bottom: 2px dotted #ffffff;
        font-size: 2.5rem;
        background-image: url("../img/feat-post-img.png");
        background-size: contain;
      }
    
      .feat-post-link {
        text-decoration: none;
        color: #ffffff;
      }
    
      .hd-feat-post {
        color: #dcbff3;
        padding-top: 0px;
      }
    
      .txt-feat-post {
        font-size: 1.5rem;
        padding-top: 0px;
      }
    
      .main-home {
        grid-area: main;
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin: 30px 30px;
      }
 <!DOCTYPE html>
  <html lang="en">

  <head>
      <meta charset="utf-8" />
      <title>Personal Blog Website</title>
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
      <link rel="stylesheet" href="css/style.css" />
      <link href="https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap" rel="stylesheet" />

Here are the CSS files for the mobile layout:Github Link

https://i.sstatic.net/mLS9c.jpg

Any help or insights would be greatly appreciated!

Answer №1

After testing on Mac Safari in responsive design mode, it appears that the gap: 20px property is not functioning as expected. Have you experienced this issue?

To address this, consider utilizing margins within the articles directly as a workaround:

.article-card {
    margin: 20px 0;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The line break refuses to concatenate

I've been grappling with trying to format and print a 9x9 2D JavaScript array into a grid, but for some reason I can't seem to get the line breaks right. Instead of displaying the array in a neat square grid, it's all coming out in a single ...

Incorporating groovy script into HTML: Is it possible, akin to embedding JavaScript

Can groovy script be embedded in HTML similar to JavaScript? I am interested in creating an onclick button event that utilizes groovy script instead of JavaScript. Thank you. ...

CSS - borders are overlapping with one another

Encountering an issue where the bottom border is overlapping the right border on the same element. Here's a visual representation of the problem: The green right border's bottom is appearing distorted due to the presence of the gray border at t ...

Employing HTML and CSS to restrict the number of characters in sentences

Extracting a few sentences from a JSON file and displaying it in a <p> tag. <p> Thank you all for another wonderful night spent together this past Sunday at The Hippodrome in Baltimore. Thank yo... <p> I want to f ...

Swap out the current image for a different one

When a user clicks on different image or color options, I want to change the main image displayed. Below are the links to the alternative images: https://i.sstatic.net/DxJEb.jpg This is the HTML code: <div class="container"> <p class="img-main" ...

A variety of negative () DOM Selectors

I've been trying to select a specific node using two not clauses, but so far I haven't had any luck. What I'm attempting to achieve is selecting an element whose div contains the string 0008, but it's not 10008 and also does not contain ...

Steps for removing all inline styles within an element:1. Access the element's

I have a group of span elements containing texts generated by tinymce. <span class="ArticleSummary"> This content is produced using a text editor and may include various inline styles. </span> Typically, this text includes numerous inline s ...

"How to ensure a background image fits perfectly on the screen in IE10

I am facing a problem while trying to set the background image in CSS to fit the screen. It works fine with the latest version of Chrome, but there is an issue with IE 10. html { border-top: 10px solid #8A85A5; background: url("http://www.lifeintempe.com/ ...

Ways to eliminate the gap produced by a fixed element

Why is my chatbox (marked in red) creating unnecessary space at the top (highlighted in yellow), even though it has a sticky position and should not be affecting that area? The other elements on the webpage seem to be impacted by this. How can I prevent th ...

Tips for reducing the JavaScript file size outputted by a liquid template generator

Currently, I am working on enhancing the performance of my Shopify website and GoogleSpeed Insights is suggesting that I minify css and js files. However, the recommended files are all created by the liquid template generator, making it challenging to uti ...

Using JavaScript to transfer the data ID from a button to a form

I am working on a project where I have a button that triggers a modal: <button type="button" class="btn btn-primary add-subscription" data-toggle="modal" data-workspace_id="{{ workspace.id }}" data-target="# ...

Calculating the width of div elements within a horizontal gallery that includes a scrollbar

My website, vladimirvojtela.com, features a gallery with a horizontal scrollbar that leaves whitespace at the end due to the width parameter in the code. Can anyone suggest a script that can automatically adjust the DIV width after all images have been ren ...

"Learn the steps to efficiently input multiple data entries with the same name from a single form into different rows within the same column of

How can I modify this form to insert four separate data entries in the same column upon submission? <form action="entry.php" method="post" > <table> <tr> <td> <input type="text" name="searchid[]" id="searchid" placeh ...

Automatically Populate Text Field with the URL of the Current Page

I am hoping to automatically fill a hidden text field with the URL of the current page so that I can keep track of where form submissions are coming from. This simple solution will help me streamline my inquiry responses and save time. To clarify, upon lo ...

The dynamic design of the webpage allows for a fluid layout, where the navigation bar smoothly adjusts its position when

I anticipate receiving criticism from certain users for not conducting enough research. However, I have dedicated two days to this issue and the lack of guidance is starting to frustrate me. Therefore, I offer my apologies if this question has already been ...

The conditional CSS appears to be malfunctioning

Hi, I am attempting to use conditional CSS in my stylesheet to set a different width for IE6. I have tried the following code but it is not working: div.box { width: 400px; [if IE 6] width: 600px; padding: 0 100px; } How can I su ...

I am encountering difficulties with generating images on canvas within an Angular environment

I am trying to crop a part of a video that is being played after the user clicks on it. However, I am encountering the following error: ERROR DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may no ...

A guide on implementing CSS and Styling in a React component

Struggling to style my React.js file that was converted from a standard web page. I have the original CSS but unsure how to use React for proper styling. Any assistance is welcomed! var NavBar = React.createClass({ render: function() { return ( ...

Opacity of absolutely positioned elements

I am currently working on creating a popup box that will gray out the surrounding area. The problem I'm facing is that the opacity of the shadow div seems to be overriding that of the popup. I have tried changing the position from absolute to fixed an ...

The "read more" button seems to be malfunctioning

I've been working on integrating a gallery of images into my posts. My goal is to display 4 images initially, followed by a "load more" button that, when clicked, will reveal another set of 4 images, and so on. I have already created the HTML, CSS, an ...