What could be the reason behind the misalignment of one of the pictures I uploaded?

I've been looking to include some buttons on the website I'm currently developing, each one leading to a different page. I decided to use images and insert hyperlinks to them, aligning them with floats. Although, it seems that something is off with the positioning, possibly due to the text alignment since I am still relatively new to HTML and CSS. The issue appears here: the last button from the left is misaligned

Here is the code snippet of my HTML:

* {
  box-sizing: border-box;
}

body {
  background: url('realheckindoggopupper.png')
}

div {
  padding: 5px;
  background-color: black;
  box-sizing: border-box;
}

.column {
  float: left;
  width: 25%;
  padding: 1px;
}

.row::after {
  content: "";
  clear: both;
  display: table;
}
<div>

  <body style="background-color:black">
    <h1 style="color:blue;text-size:50px;">Welcome to the Mamiya Mansion!</h1>
    <p style="color:white;">
      This is a place where I put all my thoughts. I talk about all my different interests here, from retrogaming, to retro-anime, linguistics, and philosophy. I don't have much here yet, more is on the way (including better CSS!), <br> but these buttons
      will allow you to access different parts I'm working on. </br>
    </p>
</div>
<div class="row">
  <div class="column">
    <a href="retrostuff.html">
      <img src="retrostuff.png" style="width:100%;">
    </a>
  </div>
  <div class="column">
    <a href="creations.html">
      <img src="creations.png" style="width:100%;">
    </a>
  </div>
  <div class="column">
    <a href="pseudstuff.html">
      <img src="pseudstuff.png" style="width:100%;">
    </a>
    <div class="column">
      <a href="misc.html">
        <img src="misc.png" style="width:200%;">
      </a>
    </div>
  </div>

Answer №1

As pointed out in the comments, it appears your final div is nested within the previous one. To correct this issue, consider rearranging your HTML structure like so:

<div class="row">
  <div class="column">
    <a href="retrostuff.html">
      <img src="retrostuff.png" style="width:100%;">
    </a>
  </div>
  <div class="column">
    <a href="creations.html">
      <img src="creations.png" style="width:100%;">
    </a>
  </div>
  <div class="column">
    <a href="pseudstuff.html">
      <img src="pseudstuff.png" style="width:100%;">
    </a>
  </div>
  <div class="column">
    <a href="misc.html">
      <img src="misc.png" style="width:100%;">
    </a>
  </div>
</div>

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

JS causes the navigator to malfunction

UPDATE: Greetings! I have developed a navigation bar that loads various pages into a specific div. Here is the source code for the navigation bar: <div id="navBar"> <ul> <li><a href="#" onClick="document.getElementById('bott ...

The input field does not accept any values even after setting it to be editable

Hey there! I have a specific requirement where I need to edit certain fields by clicking on an edit link. Initially, these fields will be disabled and in a readonly state. Once I click on the edit link, the field should become blank and editable. The issu ...

Ways to assign a CSS class specifically for images

.calendarList { background-image: url('/resource3/hpsc/common/images/calendar.png'); background-position: 135px 50%; background-repeat: no-repeat; cursor:pointer; } <input type="text" id="toDatepicker" class="cal ...

Transfer selected option with various values using JavaScript from one list to another

Currently, I am experimenting with creating a Dual List Box for forms that involve multiple selections. This setup includes two lists: one containing options to choose from and the other displaying the selected options. My approach involves using vue2 alon ...

Instructions on adjusting the height of a flexbox container to utilize the available space

I am facing a challenge in grasping the interaction between flexbox containers and other elements on a webpage. When I have only a flexbox on my page, everything works smoothly. However, when I introduce other elements, things start acting strangely. It se ...

Resize the tab header in primefaces to fit your needs

Is there a way to change the height of the tabView's header specifically in primefaces? Take for instance the tabs with headers like "God Father I", "God Father II" on this link, I only want to adjust the height of the header and not the entire tab. ...

Creating an error message display function using HTML and JavaScript when incorrect input is detected

I am having trouble creating an HTML5 and JS program that will show an error message if the user input is empty. Despite my efforts, I can't seem to get the "Error Message" to display. As a beginner, the video tutorial I'm following doesn't ...

What is the recommended way to select a checkbox using JQuery?

I have exhausted all options and nothing seems to be working. This is the checkbox in question: <input type="checkbox" onchange="WriteFormSelections('SearchForm', 'AccommodationType', 'AccommodationTypeSelections', 'A ...

Can I customize the color of an SVG image with CSS (jQuery SVG image substitution)?

This is my innovative solution for easily embedding and styling SVG images using CSS. Traditionally, accessing and manipulating SVG elements with CSS has been a challenge without the use of complex JS frameworks. My method simplifies this process, making ...

What is the reason that "<a></a>" does not act as the parent element when using jQuery to append it?

I am using jQuery to create elements and add them to existing HTML. Below is the snippet of my jQuery code: var h1 = $(data2).find("h1").html(); var image = $(data2).find(".tutorialContent .wsite-image:first-child").html(); $(".searchResults").append(&apo ...

Elevation in design ui component

I am having an issue with the height of a theme-ui component I embedded. Even though the console shows it correctly, it is displaying at 100% height. <Embed src={url} sx={{width: '800px', height: '400px'}}/> This embed is contain ...

Is it feasible to preserve the HTML form content data even after refreshing the page?

Can someone offer a suggestion that doesn't involve using Ajax? I'm wondering if there is a way to achieve this using JavaScript/jQuery or some other method. Here's my issue: When submitting a page, the action class redirects back to the sa ...

What are some other ways to include multiple HTML "submit" buttons within a form?

I am developing an app to simplify the process of writing contracts. You can check it out here: Instead of having one submit button to insert data for both contracting parties, I am looking to have separate buttons for the first and second party. This way ...

Having trouble with Bootstrap 4 maintaining consistent width when affixing the sidebar

Hello there, I'm currently working with Bootstrap 4 and trying to implement affix on the sidebar. I have set up three columns for the sidebar and made them fixed under certain conditions. However, I am facing an issue where the width of the sidebar ch ...

Implement a sequence of animations within a div using jQuery

My goal is to create an animation effect for each div element within a row when the user scrolls down to that specific point on the page. The layout consists of three <div> elements in the same row. The structure of the HTML code is as shown below: ...

Using linear-gradient() in the border-image property does not actually generate a border

I am attempting to add a linear gradient border around a dynamically created div using JavaScript. However, I am not seeing the border show up as expected and it is not displaying in black. Check out my code snippet below: const devlogList = document.cre ...

Effortless 'rotational' script

I am currently developing a HTML5 Canvas game with the help of JavaScript. My aim is to create an object that smoothly transitions to a specific direction. The direction is being stored as a variable and calculated in radians. Here's how the code op ...

Achieve a new line break when the user hits the "Enter" key using HTML and JavaScript

I'm in the process of developing a Chrome Extension that allows users to create a to-do list. My goal is to enable users to submit their task by pressing the "Enter" key, which should move the task to the next line after submission. I am currently fac ...

Vertical scroll through a list of columns with a stationary header, while allowing both the list and the header to

Check out this JSFiddle example: https://jsfiddle.net/jefftg/1chmyppm/ The layout currently has orange header columns and white list rows that scroll together horizontally. However, the goal is to have the white list rows scroll vertically while keeping t ...

sscanf disregarding the "&" symbol and continuing scanning past its intended position

I have a .cpp file that I've compiled to function as a .cgi file on my website. This file is designed to receive data from a web form and then use the sscanf() function to extract the formatted data. The issue I'm facing is that when the data is ...