Arranging the elements in my footer for optimal display

My footer layout expands and the lists in each column become misaligned as I add more links to it.

I want to make sure that the lists for each column are aligned horizontally on the same row, with the title of each column also in the same row.

levi | Using levi | legal

The image below shows the misalignment of my column headers. How can I properly align them so that the content in each column remains consistent even when more items are added to the list?

https://i.sstatic.net/4RhOb.png

This is an example of how I envision my footer to look:

https://i.sstatic.net/JxIrI.png

Here is my current jsfiddle for reference.

Here is the HTML code I am using:

<md-layout id = "container" style = "max-height:40px;">
        <md-layout md-column  md-flex-xsmall="100" md-flex-small="100" md-flex-medium="33" md-flex-large="33" md-flex-xlarge="33">
            <md-list>
                <md-list-item  class = "md-display-2">levi</md-list-item>
                <router-link :to = "{ name: 'About' }"><md-row>About</row></router-link>
                <md-row>Customers</md-row>
                 ... (additional rows here)
            </md-list>   
        </md-layout>

        <md-layout md-column  md-flex-xsmall="100" md-flex-small="100" md-flex-medium="33" md-flex-large="33" md-flex-xlarge="33">
            <md-row class = "md-display-2" >Using levi</md-row >
            ... (additional rows here)
        </md-layout>

        <md-layout md-column md-gutter  md-flex-xsmall="100" md-flex-small="100" md-flex-medium="33" md-flex-large="33" md-flex-xlarge="33">
            <md-column class = "md-display-2">legal</md-column>
            <md-column></md-column>
            <md-column></md-column>
        </md-layout>
</md-layout>

Answer №1

Embracing the power of flexbox is a fantastic solution for your query. It's easy to implement and offers incredible versatility. Take a look at this example on codepen to see how you can create a stylish footer using flexbox. This layout method holds great promise with numerous rules that are now supported by modern browsers. Feel free to unleash your creativity and design anything you desire. Good luck!

Sample HTML Code:

<div class='container'>
  <ul class="list">
    <li class="list-heading">One</li>
    <li>Two</li>
    <li>Three</li>
    <li>Four</li>
    <li>Five</li>
    <li>six</li>
    <li>Seven</li>
    <li>Eight</li>
  </ul>
  <ul class="list">
    <li class="list-heading">One</li>
    <li>Two</li>
    <li>Three</li>
    <li>Four</li>
    <li>Five</li>
  </ul>
  <ul class="list">
    <li class="list-heading">One</li>
    <li>Two</li>
    <li>Three</li>
    <li>Four</li>
    <li>Five</li>
    <li>six</li>
    <li>Seven</li>
    <li>Eight</li>
  </ul>
</div>

CSS Styling:

.container {
  display: flex;
  max-width: 600px;
  border: 1px solid #ddd;
}
.list {
  flex-grow: 1;
  padding-left: 20px;
  list-style: none;
  border-left: 1px solid #ddd;
}
.list-heading {
  font-size: 18px;
  font-weight: bold;
}

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

Adjust the color palette size when the zoom level is modified in the responsive mode within Angular

I am currently working with Angular 15 and attempting to adjust the color palette size depending on the zoom level. <input #primaryColor (change)="colorChange($event,'primary')" formControlName="primaryColor" class="co ...

The code encountered an error because it was unable to access the property 'style' of an undefined element on line 13 of the script

Why is it not recognizing styles and showing an error? All paths seem correct, styles and scripts are connected, but it's either not reading them at all (styles) or displaying an error. Here is the html, javascript, css code. How can this error be fix ...

Uploading multiple images with base64 using Laravel and Vue.js: A comprehensive guide

When attempting to upload multiple images in base64 format, I noticed that only the second image gets uploaded. Is there a simpler way to upload images using laravel and VueJS instead of using base 64? Here is an example of the VueJS method: updateIMG(e) ...

Guide on changing the order of Vue sibling components when rendering a shared array within a parent component list

Currently facing a unique challenge and seeking input: Within the 'App', utilize 'TestListItem' for odd item indexes and 'TestListBetterItem' for even indexes. The same index must be used for both components. Initial attemp ...

React - CSS Transition resembling a flip of a book page

As I delve into more advanced topics in my journey of learning React and Front Web Dev, I discovered the ReactCSSTransitionGroup but learned that it is no longer maintained so we now use CSSTransitionGroup. I decided to create a small side project to expe ...

Unmounting a Vue3 component in the script setup: A step-by-step guide

Let's say we have a component structured like this. <template> <el-card @click='destroyCard'> ...... </el-card> </template> <script setup> ...... let destroyCard = () => { ...... } onUnmoun ...

Guidelines for Implementing Stylesheets from a Referenced Node Module

I am currently developing a VS Code module that incorporates highlight.js to produce HTML for syntax highlighting of source code. Within the highlight.js npm package, there is a directory named styles containing various CSS files that I intend to utilize. ...

Contrasts between Flash and HTML5

Now that YouTube has transitioned from flash to HTML5, what are the unique features and functionalities of HTML5 that set it apart from flash? I am also curious to learn a more in-depth and intriguing aspect of HTML5 beyond what can be found through a sta ...

The information transmitted from the Laravel controller is not syncing with the Vue variable as expected

I've been working on a web app with a dashboard using Laravel and Vue. While passing data from the controller to the Vue file, the data is received correctly. However, when I try to set it to a Vue variable, the value does not update in the variable. ...

Creating a responsive YouTube video embed within a div container with a fixed background image

Hello there, I'm currently working on positioning the YouTube Iframe on the background to make it look like the video is playing on a laptop screen. I also want it to scale down appropriately with the background image on different resolutions. The w ...

Adjust the width of the initial column in the table and ensure it remains noticeable

I am a beginner with bootstrap and I find it extremely useful. I have encountered a problem with a table I am working on. I am trying to set the width of the first column and keep it always visible, but I am having trouble achieving this. I have successful ...

How can I resize an element using jQuery resizable and then revert it back to its original size with a button click?

I need help figuring out how to revert an element back to its original size after it has been modified with .resizable. I attempted the following: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="//code. ...

Is it possible to create distinct overlapping divs without using absolute positioning?

I'm seeking assistance in developing the view shown below. I am familiar with using position absolute, but I'm wondering if there is a way to achieve this without relying on absolute values. https://i.sstatic.net/m13cl.png ...

Switching the color of links when they are focused, without changing it when they are clicked by either a mouse or

Is there a way to change the color of a link only when a user navigates to it using the TAB key and not when they click on it? The simple CSS solution I found was: a:focus { color: red; } However, this also changes the color when the link is activated by ...

Is it possible to show one element while hiding others upon clicking using JavaScript?

Concept My idea is to create a website with a navigation menu where only one section is visible at a time. Each section would become visible upon clicking a specific button in the navigation bar. Challenge I attempted to achieve this using the following ...

The functionality of CSS scroll snap does not seem to be compatible with the CSS Grid

When utilizing CSS scroll snap with Flexbox, the snapping functionality works adequately: * { box-sizing: border-box; margin: 0; padding: 0; } .slider { font-family: sans-serif; scroll-snap-type: mandatory; scroll-snap-points-y: repeat(100vw ...

Styling a <slot> within a child component in Vue.js 3.x: Tips and tricks

I'm currently working on customizing the appearance of a p tag that is placed inside a child component using the slot. Parent Component Code: <template> <BasicButton content="Test 1234" @click="SendMessage('test') ...

Obtain data from a local JSON file using the http.get() method in Angular 2

I am attempting to utilize the http.get() method in Angular 2 to load a local JSON file. I followed a suggestion from Stack Overflow that involves modifying my app.module.ts: In this example, I have imported the HttpModule and the JsonModule from @angular ...

Challenges with implementing ng2-auto-complete in Angular2

I successfully integrated the Angular 2 ng2-auto-complete component into my project by following this helpful tutorial. The code is also available on GitHub. The current challenge I am encountering involves the formatting of my data source. It is structur ...

React App Showing Scrollbar When Material UI AppBar is Present

I'm encountering a straightforward issue in my React application. How can I get rid of the scrollbar on my page? It seems like the problem arises from the height value I set to 100vh. However, upon removing the AppBar, the scrollbar disappears. Any su ...