Arranging text links in a column format

I am attempting to align a series of text links vertically, but for some reason, some of the links are not stacking properly.

Here is the current layout: https://i.sstatic.net/1gonA.jpg.

This is how I want it to look: https://i.sstatic.net/oH0Ap.jpg

Below is the code that I have been working on:

HTML:

    <footer class="footer">
      <div class="bottom-column">
        <div class="bottom-header">STREETZ</div>
        <a class"bottom-link" href="#Home">Home</a>
        <a class"bottom-link" href="#About">About us</a>
        <a class"bottom-link" href="#Sitemap">Sitemap</a>
        <a class"bottom-link" href="#Blog">Blog</a>
        <a class"bottom-link" href="#Blog">Privacy Policy</a>
        <a class"bottom-link" href="#Blog">Terms of Service</a>

      </div>

      <div class="bottom-column">
        <div class="bottom-header">SUPPORT</div>
        <a class"bottom-link" href="#Home">FAQ</a>
        <a class"bottom-link" href="#About">Contact us</a>
        <a class"bottom-link" href="#Sitemap">Shipping</a>
        <a class"bottom-link" href="#Blog">Returns</a>
      </div>   
    </footer>

CSS:

     .footer {
      position: relative;
      width: 1024px;
      height: 200px;
      background: #f5f5f5;
      margin: 0 auto;
      top: 1255px;
      border-top: 1px solid #d8d8d8;
    }

    .bottom-header {
      font-size: 14px;
      line-height: 20px;
      position: relative;
      color: #333;
      text-transform: uppercase;
    }

    .bottom-column {
      float:left;
      display: inline;
      font-size: 15px;
      width: 105px;
      height: 160px;
      padding: 20px;
    }

    .bottom-column a {
      text-decoration: none;
      color: #6a6a6a;
      float: left;
      left: 50px;
      padding-top: 10px;
      font-size: 13px;
    }

Answer №1

Consider trying the steps below:

.footer-links a {
    display: block; //This will stack the text links vertically
}

Make sure to eliminate the float:left property from .footer-links a {...}. Having float there is what's causing the links to align next to each other.

Feel free to check out this example link.

Answer №2

For better alignment, consider adding 'clear: both;' to the CSS rule for .bottom-column links

.bottom-column a {
  text-decoration: none;
  color: #6a6a6a;
  float: left;
  left: 50px;
  padding-top: 10px;
  font-size: 13px;
  clear: both;
}

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

What's preventing me from aligning this div in the center?

I'm trying to set up a layout with two centered columns for Tumblr posts on the left side, while keeping a sidebar on the right. Can someone help me achieve this? #wrapper /*applying styles for two columns*/ { display: inline-bloc ...

Compress a CSS file with PHP

When using the code below to remove all newlines and spaces from a CSS file, it may cause an issue if the file contains the following: .sample { padding: 0px 2px 1px 4px; } The output will be: .sample{padding:0px2px1px4px;} However, I actually want ...

Attempting to arrange form input fields into groups of three columns

I am facing a challenge in arranging my input fields within the form in a column of 3. The issue is that I have more code than anticipated, making it difficult to achieve this layout. Despite several attempts, nothing seems to be working. I have spent hour ...

What are the steps to design a curved trapezoid using CSS?

Is it possible to achieve this using CSS? This is the current progress I've made: div { -webkit-clip-path: polygon(0 79%, 60% 78%, 78% 100%, 0 100%); clip-path: polygon(0 79%, 60% 78%, 78% 100%, 0 100%); background:red; height:300px; ...

Background image not displaying

My web page has a background image set using this CSS: body, html { background-image: url(Content/Images/bg-lounge-2-l.jpg); background-repeat: repeat; background-attachment: fixed; /*background-position: 0 -390px;*/ } ...

How can I send data to a Python script from a web application?

I have a Python script that requires 6 parameters to run, provided through the command line. python_file.py param1, param2, param3, param4, param5, param6 My goal is to pass these parameters from a web application built with Flask and Bootstrap. I want e ...

After closing, remove the #about section from the URL

One of the buttons on my webpage triggers an overlay using JavaScript that directs to a URL like the following: However, when the close button is clicked, the overlay is removed but the "/#about" part of the URL remains. What is the most effective method ...

Prevent event bubbling when clicking

I have a code snippet that I'm struggling with. <p>haha</p> <button class="btn btn-light" onclick="nextSibling.classList.toggle('d-none');"> <i class="fa fa-ellipsis-h"></i> </button> <div class= ...

Using WordPress to display identical blog content across several websites

I currently have a Wordpress blog set up at blog.mydomain.com. I am in the process of creating a mobile version of my website at m.mydomain.com, which will include a section for the blog. My goal is to use the same database and pull in all the existing blo ...

Displaying a pop-up window upon clicking on an item in the list view

After creating a list where clicking an item triggers a popup, issues arose when testing on small mobile screens. Many users found themselves accidentally tapping buttons in the popup while trying to view it. What is the most effective way to temporarily ...

Alter the background of a div in a webpage using PHP and jQuery to display a

I have a collection of 10 background images for each season (Spring, Summer, etc.) stored in folders labeled 1, 2, 3, and 4. I am looking to randomly change the div background image for each season. For example, changing the random image from folder 1 for ...

How to dismiss a JavaScript alert without refreshing the page in Codeigniter 3

I am currently working on building a form with validation using both JavaScript and Codeigniter 3.04. Here is the HTML code for my form: <form class="form-horizontal" method="POST" onsubmit="check()"> //code </form> My goal is to validate t ...

When I type in the TextBox, the CheckBox value should be deactivated if it is unchecked

Whenever I attempt to input text into the textbox associated with my checkbox, the checkbox automatically becomes unchecked. How can I prevent this from happening? <span id="TRAVEL_TYPE_1"><input id="TRAVEL_TYPE_0" type="checkbox" onclick="Update ...

Steps for retrieving the image URL after clicking on an image within a list of images

I have a list of images in the index file shown below: <div id="image-list" <ul> <li data-id='1'> <img src='image/001.jpg' alt=''> </li> <li data- ...

How to add vertical bars within ng-repeat in AngularJS

I attempted to retrieve values from an array variable using ng-repeat within unordered lists. Although the values are displaying correctly and everything is functioning properly, I added vertical bars after each value to represent sub-categories on my page ...

Bulma's Grid System Spans Columns Across the Entire Viewport

Utilizing the Bulma CSS framework. In my attempt to arrange some elements, I am puzzled as to why, in a desktop view, the items do not transition to the next row once they exceed the viewport. Below is a snippet of code along with a link to a JS Bin exam ...

Guide on integrating JSON data into Bootstrap 4's secondary dropdown menu

I have a vision of my desired outcome in the attached image. Each menu item should contain two additional items, 'Dashboard' and 'Battery Trends', each with unique URLs defined as 'navigationurl' in the JSON file. My attempt ...

What could be causing the error.status value to not be displayed on my Embedded Javascript (EJS) page?

Currently utilizing ejs, node.js & express along with other packages I'm facing an issue where the error.status and error.stack values are not appearing on the rendered page. I suspect that the error variable may be undefined or inaccessible within t ...

Collect input from the user for multiple lists and send them to PHP for additional processing

I'm struggling to find the error in this code... I keep getting "undefined index user_list" as the error message. Essentially, I am trying to allow users to input values into a list and then store that entire list in a database. <?php if(isset($_ ...

How can you achieve a seamless or infinite scrolling effect on a webpage?

My idea is as follows: Imagine a long web page where, instead of the scrolling coming to an abrupt stop when the user reaches the end, I want the page to reload from the bottom and allow the scrolling to continue seamlessly. Specifics Picture this - as ...