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 7624067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:51:58+00:00 2026-05-31T04:51:58+00:00

( jsFiddle example ) I have a <ul> with its <li> s aligned to

  • 0

(jsFiddle example)

I have a <ul> with its <li>s aligned to the right. I’d like them to be positioned such that only about 20px of the element is showing on the right side of the <ul>, and on hover they go to their normal positions. This will be combined with overflow: hidden; on the container so the elements are partially hidden to begin with and slide in from the side (with CSS3 transitions).

In this jsFiddle example (overflow: visible for illustration) I was able to slide the elements in to the right position, but how do I align them such that they lie with 20px inside their container to start with? The best I could do was keep them right-aligned and push them all the way outside their container.

I played with changing the elements’ widths, but if they contain multiple words the text wraps and the height changes (or with overflow: hidden the words just disappear when the width is too small), which is unacceptable.

It’s acceptable (but less interesting and less preferable) to use fixed-width <li>s, if necessary, but I’d like to see other solutions.

  • 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-05-31T04:51:59+00:00Added an answer on May 31, 2026 at 4:51 am

    If the UL itself has a fixed width, you could position the LI’s ({UL_width} – 20) pixels from the left of the UL. I would probably do something like…

    <ul>
        <li><span>Item #1</span></li>
        <li><span>Item #2</span></li>
    </ul>
    ...
    

    The following CSS should give you the desired effect…

    ul { width: 200px; }
    ul li {
        position: relative;
        height: 15px;
        overflow: hidden;
    }
    ul li span {
        position: absolute;
        top: 0;
        left: 180px;
    }
    

    Something along those lines should do the trick. Then just do a rollover to adjust your left property of the ul li span.

    NEW CSS

    ul { width: 200px; }
    ul li {
        width: 200px;
        text-indent: 180px;
        height: 15px;
        overflow: hidden;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSFiddle that seems like it should work but it doesn't. function
Take the example I have setup at http://jsfiddle.net/vEF6y/ Click on the 'add item' button
I have created a little example,please have a look, http://jsfiddle.net/bWTwL/ I want to have
Here's an example of my problem on jsFiddle. I have a table with striped
This jsfiddle example shows what I'm talking about, I gave the div in question
Hi I have a function that i want to pass an element to via
I have an example: http://jsfiddle.net/kamaci/uVQZc/3/ When I animate bigger blue div, I want to
Its hard to explain so i have an example I have a left part
I have problem that I have element inside TD element and when I set
I have an example here: http://jsfiddle.net/d3E3M/ I have 3 lines (line 1, line 2

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.