Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8362979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:04:10+00:00 2026-06-09T12:04:10+00:00

I have a <ul> list, all <li> items are displayed horizontal. What I want

  • 0

I have a <ul> list, all <li> items are displayed horizontal. What I want to do is make the last two <li> items stack vertically when the browser gets too small for them all to remain horizontal, instead of dropping to the next line.

I have created a jsfiddle example

So as you can see all the items align horizontally, but as you narrow the display window, instead of items 5 and 6 dropping to the next line I want then to stack horizontally and stay on the same line.

How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:04:11+00:00Added an answer on June 9, 2026 at 12:04 pm

    Use text-align property in your <ul> it may help you.

    use Like this:

    ul {
        display: inline-block;
        text-align: right;
    }
    

    Working Demo

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ul with tree list items in an horizontal view. All the
In my directory I have subfolders, and I want to list all directories like
I have a list of objects and I want to remove all the ones
I have a list of lists and want to replace all the occurrences of
I would like to have images displayed in a horizontal list. This is what
I have a list of items displayed in the UI. They are in the
I have a ListBox , on_button click, I want all the items in the
I have two tables, one table is the items container, which holds all data
I have a List<List<String>> I need to get a List of all possible concatenation
I have a PhoneGap app, where I need to list all the user's friends,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.