Restoring list item to standard CSS styling

I am having trouble with the alignment of my links. They are currently displayed in a horizontal manner instead of vertically like this:

  1. First link
  2. Second link
  3. Third link

The current layout shows the links next to each other as follows:

First link Second link Third link.

* {
    margin: 0;
    padding: 0;
}

h2 {
    float: left;
    font-size: 17px;
    font-weight: 500;
}

a {
    color: #15c;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

body {
background: #fff;
font: 12px Arial, Helvetica, Verdana, sans-serif; 
color:#000;
margin:0;
}

header {
    width: auto;
    height: 60px;
    min-width: 980px;
    padding: 0 30px 0 15px;
    background-color: #fafafa;
}

header ul {
    float: right;
    list-style: none;
}

header ul li {
    float: left;
    color: #8c8989;
    line-height: 60px;
    margin-left: 20px;
}

header ul li a {
    color: #8c8989;
}

.logo {
    float: left;
    width: 125px;
    height: 36px;
    margin: 12px 30px 0 0;
    background-color: #fff;
}

.add-product {
    color: #fff;
    width: 70px;
    height: 28px;
    font-size: 15px;
    margin-top: 14px;
    line-height: 28px;
    border-radius: 2px;
    text-align: center;
    cursor: pointer;
    background-color: #EA4335;
}

.add-product:hover {
    background-color: #32ba55;
}

.add-product a {
    color: #fff;
    text-decoration: none;
}

.add-product a:visited {
    color: #fff;
}

.search-box {
    float: left;
    width: 450px;
    height: 32px;
    border: 1px solid #d7d7d7;
    margin-top: 12px;
    padding-left: 15px;
    border-right: none;
    border-radius: none;
}

.inner-header {
    width: 100%;
    height: 60px;
    border-bottom: 1px solid #ebebeb;
}

.side-panel {
    float: left;
    width: 188px;
    height: auto;
    background-color: red;
}

.side-panel ul {
    float: left;
}

.side-panel ul li {
    margin: 5px 0 5px 0;
}

.side-panel ul li a {
    color: #fff;
}
<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Google Project | Seller Central</title>
<link rel="stylesheet" type="text/css" href="styles/seller-central.css">
</head>
    
<body>
    <header>
        <a href="?q=home">
        <div class="logo"></div>
        </a>
        <ul>
            <li>
                Hi, Guest
            </li>
            <li>
                <div class="add-product"><a href="#">Add +</a></div>
            </li>
        </ul>
    </header>
    <div class="inner-header"></div>
    <div class="side-panel">
        <ul>
            <li>
                <a href="#">My Products</a>
                <a href="#">Sold Items</a>
                <a href="#">Messages</a>
            </li>
        </ul>
    </div>
</body>
</html>

I am focusing on adjusting the links within the "side-panel" div for better display.

Your assistance is greatly appreciated!

Answer №1

Take a look at this code snippet

The issue you were experiencing was due to all the menu items being contained within a single <li>. By splitting them into 3 separate <li> elements, you will achieve the desired outcome.

Check out the revised HTML below

HTML

<header>
  <a href="?q=home">
    <div class="logo"></div>
  </a>
  <ul>
    <li>
      Hi, Guest
    </li>
    <li>
      <div class="add-product"><a href="#">Add +</a></div>
    </li>
  </ul>
</header>
<div class="inner-header"></div>
<div class="side-panel">
  <ul>
    <li>
      <a href="#">My Products</a>
    </li>
    <li>
      <a href="#">Sold Items</a>
    </li>
    <li>
      <a href="#">Messages</a>
    </li>
  </ul>
</div>

Answer №2

Try this alternative

<ul style="list-style:none">
        <li><a href="#">My Items</a></li>
        <li><a href="#">Items Sold</a></li>
        <li> <a href="#">Notifications</a></li>
</ul>

This code can be more visually appealing. Alternatively, you can use

<a href="#" style="display:list-item"
>

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

CSS-only: Align items in flexbox column with equal width and centered position, without the need for a wrapper

https://i.stack.imgur.com/vAJv2.png This particular challenge involves creating a responsive mobile menu. In this design, the width of all children is determined by the longest child element. The CSS should ensure that the .index class spans the full wi ...

Form Validation Issues Detected

Could someone help explain why the code below is causing an error according to W3C guidelines: <form id="" method="post" action="" /> <input type="text" name="" title="" tabindex="10" class="" /> <inp ...

Is your Javascript navigation functioning properly on some submenus while encountering issues on others?

If you visit , you'll notice that it's a visually appealing site. The navigation submenus seem to be functioning properly, HOWEVER upon inspecting the element, you'll notice that under the PRICING tab, there are submenus that have the same c ...

What is the best way to split two divs in this manner?

Is there a way to split two divs like this in such a manner using TailwindCSS? Alternatively, what would be the CSS code for dividing these two divs? I am struggling with this concept and cannot wrap my head around how it can possibly be achieved. ...

PHP and MySQL combination for efficient removal of multiple dropdown choices

I'm struggling to figure this out. Essentially, it's a form with multiple dropdown menus where users can select one or more items to filter MySQL data results. I want to dynamically update the other dropdown menus as the user makes selections. Fo ...

Menu selection without javascript

Recently, I encountered an issue with a menu containing tabs. When hovering over a tab, a list of items appears at the bottom of the tab. However, I decided that I wanted this list to transition downwards instead of simply appearing (previously set as disp ...

Round up all the hyperlinks within a paragraph and organize them neatly into a list

Let me present a scenario: <p class="links">Lorem <a href="#">diam</a> nonummy nibh <a href="#">Lorem</a></p> Following that, I have a lineup: <ul class="list"> </ul> How do I achieve this using jQuery? ...

HTML unique flex wrapping

https://i.sstatic.net/ekVr4.png #menu { display: flex; justify-content: space-evenly; align-items: center; margin: 0 5px 0 5px; height: 30px; flex-wrap: wrap; } .menu_item { margin: 0 10px 0 10px; } .menu_item2 { margin: 0 10px 0 10px; } <div id="m ...

Transmitting live video to rtmp using the client's web browser

Is it feasible to stream video from a client browser to an RTMP server without using Flash? I am searching for an alternative solution. https://github.com/ahyswang/actionscript-publisher I found this to be effective, but it relies on Flash. Do I need to ...

Personalize the styling of Material UI Tables - final element customization

I've been attempting to adjust the padding of the Material UI Table. The last-child element is receiving a 24px padding which I'm trying to modify. Despite my attempts at overriding the theme and using classes{{root: classes.xxx}}, I haven't ...

Having trouble with uploading images?

I'm having issues with using PHP to upload an image to a folder. Can someone please help me troubleshoot this? Thank you! Here is the code for setup.php <?php include("../includes/config.php"); ?> <?php if ($_SESSION["isadmin"]) { ...

Is it possible to align text to an image within an input text field?

<input type="text" class="usernm" style="color:black;font-weight: bold;outline-width: 0;" id="username" /> I have a question about styling HTML. I am attempting to include an icon inside a text field, but I'm strugglin ...

Guide on making a custom page by substituting specific text with user-provided input based on an existing sample page

I'm looking to create a webpage with a form <form class="col s12" method="POST" action="addtask.php"> <div class="row"> <div class="input-field col s6"> <input placeholder="Username" id="user" type="text" class="v ...

Exploring JSON Object with ng-disabled in AngularJS

One unique feature of my web application is the ability to add new users (username + password) through a form. To prevent duplicate usernames, I have a JSON object called l_usernames defined in a controller named UsersController. This object contains all u ...

Utilize the arrow keys to navigate through the search suggestions

I am facing an issue with my search bar where I am unable to navigate through the suggestions using arrow keys. I have been struggling with this problem for days and would appreciate any help in resolving it. var searchIndex = ["404 Error", "Address Bar ...

"Troubleshooting: Why is my Bootstrap modal window only printing a

I've encountered an issue with printing the content of a Bootstrap modal window. Previously, the code I had was working fine but now it seems to be malfunctioning. Content is dynamically added to the form using appendChild() in a separate function. Ho ...

Ways to deselect checkboxes and eliminate validation requirements

Below is the HTML code snippet that I am working with: <div class="form-group"> <div class="input-group"> <label for="daterange-vacancy" class="input-group-addon">Van</label> ...

A guide on choosing a custom button color and automatically reverting to its original color when another button is clicked

I have a collection of 24 buttons, all in a dark grey (#333333) shade. Whenever I click on one of the buttons, it changes to a vibrant blue color (#0099ff), which is functioning correctly. However, when I proceed to click on another button, the previous ...

HTML file selector with multiple file selections - accessing active files

Encountered a problem while using Firefox version 73 on Windows 7: In my code, I am using a multi-file-picker in HTML to upload up to 100 files in parallel: <input type="file" id="files" name="files" multiple> The files are sent to a REST API for ...

How come the margin-bottom is displaying as the margin-top?

When I attempt to add margin-bottom on a div inside its parent, it seems to display as the parent's margin-top. Why is that? HTML: <div id="wrapper"> <div id="content"> <div id="box"></div> </div> </d ...