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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:38:49+00:00 2026-05-25T12:38:49+00:00

How can I align the red box on the right ? I tried using

  • 0

How can I align the red box on the right ? I tried using relative and margin but each browser aligns them differently. Some align them farther up and others farther down.

<ul><li>
<img src="" >
<div class="one"></div>
<div class="two"></div>
</li><li>
<img src="" >
<div class="one"></div>
<div class="two"></div>
</li><li>
<img src="" >
<div class="one"></div>
<div class="two"></div>
</li><li>
<img src="" >
<div class="one"></div>
<div class="two"></div>
</li></ul>
li {float: left;}
div.one {position: relative; top: 1em; left: 2.5em; width: 5em;}
div.two {position: relative; top: -5em; left: 10em; width: 5em;}

Example Image

  • 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-25T12:38:50+00:00Added an answer on May 25, 2026 at 12:38 pm

    Welcome to SO, Jane.

    Here’s one way to do this… using display:inline-block;

    li{
        float: left; 
        background:black; 
        border:1px solid green; 
        width:55px;
    }
    
    li img{
        display:block; 
        width:55px; 
        margin:0 auto;
    }
    
    div.one, div.two{
        background:red; 
        display:inline-block; 
        height:20px; 
        width:20px; 
        margin-left:3px;
    }
    

    Note: you will need to adjust the measurements to suit your situation.

    Example: http://jsfiddle.net/jasongennaro/SctmD/1/

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

Sidebar

Related Questions

I am trying to right align a control in a StatusStrip . How can
I have three values I need to align in a dropdown box. How can
I am using Eclipse & JDE 4.5.0 plug-in. How to align fields vertically. Can
How can I modify this: <div style=border: solid 1px red; text-align: center> <div style=background-color:
I know it is an humiliating and basic problem, but I can't align the
How can I vertically align a Label and TextBlock at Top so that their
I can't seem to get this text to align vertically. Can someone please tell
I'm experimenting with DIVs to align my page's contents: http://labs.pieterdedecker.be/test/test.htm As you can see,
I am facing trouble with indent and align format of pdf generated in Red
I can horizontally align a div and all the content looks nice. Looking to

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.