Designing numerous vertical lists in HTML

I need help with displaying multiple lists vertically using HTML

For example:

+--------+---------------------------------------------+--+
| Global | Region Country Currency Account Type Entity |  |
+--------+---------------------------------------------+--+
| Global | Asia                                        |  |
|        | Africa                                      |  |
|        | Europe                                      |  |
|        | America                                     |  |
+--------+---------------------------------------------+--+

Here is a link to my JSFiddle code. It currently displays 4 rows correctly but the last 2 rows are overlapping on the first two rows.

If anyone could assist me with this issue, I would greatly appreciate it.

Answer №1

Consider replacing :

ul li {
  display: inline-block;
  width: 20%;
}

With:

ul li {
  display: inline-block;
  margin-left:15px;
}

JSfiddle Sample

Answer №2

To prevent the <ul> from overlapping, I made a simple adjustment by increasing the top margin.

ul li ul {
  width: 100%;
  margin: 10px 0px;  /* By setting the margin to 10px, it creates vertical space */
  padding:0px;       /* The same effect can be achieved with padding */
}

Take a look at the updated JSfiddle for the solution in action.

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

Understanding Arrays in Angular JSIn this article, we

I am new to working with Angular JS. Currently, I am populating an array and attempting to showcase its contents on the HTML page using ng-repeat. $scope.groupedMedia = []; // Elements are being added through a for loop. $scope.groupedMedia[year].push(r ...

Is the column-fill property malfunctioning in Chrome?

column-fill: balance; is said to "equally divide content between columns". It appears to be functioning correctly in Firefox and Edge. However, Chrome (and Opera) seem to have a strong aversion to the second column, leaving it mostly empty. It seems to be ...

What is the best way to retrieve the value of a component's HTML id tag in React?

Is there a way for me to retrieve the id of a react component from within the component itself? I need this information to perform some tasks with a third-party library. In Ember, you can access the component's id using elementId, which can be found ...

Tips for successfully passing a Prop using the Emotion CSS function

Passing props through styled() in Emotion is something I'm familiar with. For example: const Container = styled("div")<{ position: string }>` display: flex; flex-direction: ${({ position }) => (position === "top" ? "column" : "row ...

Floating color problem

Do you know why the social icons turn black when hovered over? Could it be related to the navbar buttons? Is there a way to change the hover color to blue or red only? Link to code snippet <body> <nav class="navbar navbar-default navbar-fixed-t ...

Sliding Image Menu using jQuery

I am struggling with creating a menu using jquery mouseenter / mouseout effects. My goal is to have a small icon displayed that expands to the left and reveals the menu link when a user hovers over it. The issue I am facing is that the effect only works w ...

Choose an image to be displayed at either full width or full height, depending on which dimension is reached first

I have a query regarding resizing an image within a div to either 100% width or 100% height of the containing div. Despite setting max-height and max-width to 100% as recommended here, I still encounter overflow issues without wanting to crop the image usi ...

Error in Typescript: Function not being triggered on button click

As someone who is just starting out with typescript, I've been tackling a simple code that should display an alert message in the browser when a button is clicked. I've experimented with the button and input tags, as well as using both onclick ev ...

Tips on creating a post that can be viewed exclusively by one or two specific countries

I'm stumped on how to create a post that is visible only to specific countries. How can I code it to determine the user's country without requiring them to make an account? Any advice or hints would be greatly appreciated. ...

Trouble with Google Web Fonts appearing incorrectly on Chrome for Windows 7

Currently facing an issue with a website I am developing using Wordpress: In Chrome, running on Windows 7, the body text on the homepage is supposed to be displayed as a Google Font. However, for some reason, the last line of the text is appearing in the d ...

Persistent navigation once fullscreen banner is completed

I have a full screen header on my one-page website. Below the hero section is the navigation element, which I want to be fixed after scrolling past the height of the full screen. Here's what I currently have in terms of code. HTML: <div id="hero" ...

Issue with PHP's ng-click not functioning properly with Angular JS's dynamic HTML generation

I'm just starting out with Angular JS. I'm trying to create an ng-click event in dynamically generated HTML from PHP, here's the code snippet. var app = angular.module('pageapp',[]); angular.module('pageapp') .filter(& ...

The issue with Bootstrap Vue is that it fails to render the CSS properly when utilizing cards

Recently, I delved into the world of Bootstrap Vue and wrote the code snippet below: <template> <div> <div> <b-card-group> <b-card border-variant="dark" header="Dark" align="center"> &l ...

Can CSS3 animations be executed sequentially for each child element?

Have you ever tried creating a CSS3 animation in HTML? You can check out an example here. <div class="parent"> <a href="#">First</a> <a href="#">Second</a> <a href="#">Third</a> </div> With the ...

Initiating a click function for hyperlink navigation

Here is the HTML and JavaScript code that I am currently working with: <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-3.3.1.min.js"></script> </head> <body> <a href="#f ...

What are some ways to enhance the appearance of the initial two items in a list through CSS?

Is it possible to enhance the appearance of the first 2 elements in a list using CSS for IE8 compatibility? Here is an example of the format: <ul id="list1" style="margin-left:-20%;font-weight:bold" > <li class="xyz"> Element1 </li> ...

I'm having trouble getting rid of this stubborn loader on the website

I am currently utilizing the following template: . My objective is to eliminate the preloader progress bar that displays the loading progress of the page in percentage. The files associated with this preloader are as follows: Loader CSS File - www[dot]the ...

creating a custom data display with Flask

Hey, I'm having some trouble getting my table to work. Can anyone help me with this issue? Here's the python code: @app.route('/books') def result(): dict={'Series Title': 'Batman Vol.1: The Count of the Owls', ...

Update the radio button to display the value entered in the text input field

I'm trying to implement a feature where the value of a text box can be set as the value of the selected radio button. Below is the code I have: HTML <form action="add.php" id="registration" method="post" name='registration' onsubmit="re ...

Facing issues with integrating json data into html through svelte components

Just starting out with svelte and taking on a project for my internship. I have my local json file and I'm struggling to integrate it into my HTML. I've been scouring the internet but haven't found a solution yet. This is what I've tr ...