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

Design your HTML select element with a unique custom arrow where the text elegantly appears over the arrow

I've encountered an issue with a select element in my HTML page that has a custom arrow. The problem is that the text within the select element overlaps with the arrow, which is not desired. I'm seeking a cross-browser solution for this specific ...

Can one utilize HTML's .querySelector() method to target elements by xlink attribute within an SVG document?

Here is the scenario: <body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <a xlink:href="url"></a> </svg> </body> Now, can you utilize the HTML DOM's .querySe ...

Fetching Information from Firebase and Populating Dropdown Menus on a Website

Displayed below is a code snippet from a .JSON file stored in a Firebase database. "questionnaires" : { "ORANGE" : { "location" : "ny", "major" : { "engineering" : { "ECE" : { "3rd sem" : { "2018 ...

When you hover over the text, the color will shift

I have created two boxes that are blue with white text and change to a different color scheme when hovered over. However, I am experiencing an issue where the text color reverts back to the original color when hovering below the text area of the box. Here ...

struggling to access the value of a hidden field by using the parent class name

My coding experience so far looks like this- <tr class="chosen"> <td id="uniqueID">ABCDE5678</td> <input type="hidden" value="000005678" id="taxCode"> <td id="fullName">Z, Y</td> </tr> In this scenario, I need to ...

What is the proper way to write the code for this form?

I am exploring alternatives to using the html TABLE tag and struggling to create the desired layout. I have attached a screenshot showing my table design. How can I achieve the same layout using divs or spans while still maintaining vertical alignment of t ...

What is the process for aligning rows with the selected option from the drop-down menu

Alright, so here's the scenario: I have created a table along with two drop-down filters. The first filter is for selecting the Year, and it offers options like "All", "2023", "2022", and "2021". When I pick a specific year, let's say "2022", onl ...

Personalizing CSS classes in ASP.NET

In the project I'm currently developing, users will have the ability to customize the font color of header titles. These header titles are styled using values from a cssClass, which includes properties such as font-size, font-color, font-weight, and ...

Just finished my first webpage - can't seem to get the footer to stay put!

After spending 3-4 months learning HTML and CSS, I am now working on my first web page. However, I'm facing an issue where the footer is stuck to the slideshow and I can't seem to figure out how to position it at the bottom of the page. Any tips ...

Ways to transform a poster into a clickable link in an HTML video

I am currently working on embedding an mp3 audio file in a browser, along with an accompanying image and a URL for redirection upon clicking. To achieve this, I have placed the mp3 file within a video tag and designated the image as a poster using the foll ...

Creating an Eye-catching Presentation: Tips for Adding Text to Your CSS3 Slideshow

I am currently in the process of creating a CSS3 slideshow with text for each image. I found inspiration from this example: . However, I made some modifications to make it responsive. Here is the HTML code I have used: <div id="slideshow"> < ...

The bootstrap table did not meet my expectations as I had hoped

I am currently using Bootstrap to create a basic two-column table similar to the one on the Bootstrap website here: http://getbootstrap.com/css/#tables. To achieve this, I have implemented a javascript function to display the table as shown below: $(&bso ...

The issue with material-ui 0.15.2 is that it applies extra vendor-prefixed styles on the server side but not on the client side, resulting in warnings in React 15

I have set up my project with the following configurations: react is at version 15.2.1 material-ui is at version 0.15.2 I am using express and universal-router for server-side rendering Every time I include a material-ui component, I encounter this erro ...

VueD3tree successfully fetches data, however, it is not being displayed on the screen

Just started delving into Vue and VueD3tree. Attempting to display a tree using the vued3tree library with data pulled from an API. Strangely enough, when trying with static data, the tree displays perfectly fine. However, when fetching data dynamically, a ...

Enhancing Your Website with Multiple Background Images in CSS3

Having trouble understanding how to position multiple background images with CSS3. I'm struggling to get them to display at the top, middle, and bottom of the page. Can you help me figure out how to make an image appear at different positions using a ...

The page's dimensions exceed the size of the device screen

I created this basic HTML content using React <!doctype html> <html><head><title data-react-helmet="true"></title><style type="text/css" data-styled-components="" data-styled-components-is-local="true"></style>< ...

creating a custom website layout

Currently, I am in the process of developing a website and I am absolutely obsessed with the page design. For instance: I have a page that can be divided into two sections - the left side and the right side. The left side consists of various menus, while ...

CakePHP allows developers to easily include images in their links using the `$this->Html->link` method. However, instead of generating HTML code for the image, it outputs ASCII characters

I can't seem to find the solution in the CakePHP 2.3.0 manual. I am trying to use $this->Html->link with $this->Html->image to create a clickable image. However, I'm encountering an issue where the ASCII rendering of quotes is being generated ins ...

Tips for applying an active class to buttons using ng-click?

Here is the HTML code for the buttons. The taskfilter is the filter that controls how the buttons work when clicked and the class name is 'sel' <a class="clear-completed" ng-click="taskfilter = 1" ng-class="{'sel':enabled}"> &l ...

Guide on automatically logging in to a specific website using Selenium with Kakao, Google, or Naver credentials

I encountered an issue with my selenium login code for a particular website, where the keys seem to be generating errors. https://i.stack.imgur.com/wJ3Nw.png Upon clicking each button, it brings up the login tab. However, I keep encountering this error ...