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

  • Home
  • SEARCH
  • 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 7983857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:05:20+00:00 2026-06-04T11:05:20+00:00

I have some very basic code and it works except everything aligns to the

  • 0

I have some very basic code and it works except everything aligns to the top…ideally the bars would align to the bottom. I suppose I could use fixed positioning as the dimensions are squared at 50px by 50px but I’d prefer something a little less “fixed”.

      <div style="border: 1px solid #aeaeae; background-color: #eaeaea; width: 50px; height: 50px;">
        <div style="position: relative; bottom: 0; float: left; width: 8px; height: 22px; background-color: #aeaeae; margin: 1px;"></div>
        <div style="position: relative; bottom: 0; float: left; width: 8px; height: 11px; background-color: #aeaeae; margin: 1px;"></div>
        <div style="position: relative; bottom: 0; float: left; width: 8px; height: 6px; background-color: #aeaeae; margin: 1px;"></div>
        <div style="position: relative; bottom: 0; float: left; width: 8px; height: 49px; background-color: #aeaeae; margin: 1px;"></div>
        <div style="position: relative; bottom: 0; float: left; width: 8px; height: 28px; background-color: #aeaeae; margin: 1px;"></div>
      </div>

I don’t want to use a library or JS add on. Keeping this light weight is mission critical.

Also I’d prefer the bars were vertical. Any CSS guru care to shed the bit of light I seem to be missing? I’ve googled and most examples are far to complicated/sophisticated,

  • 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-04T11:05:22+00:00Added an answer on June 4, 2026 at 11:05 am

    First of all, separate your CSS from your HTML. You’re repeating too much code when you could just use a bar class for your inner divs.

    bottom: 0 doesn’t change anything for relatively positioned div.

    If you wish to use relative positioning, get rid of float and bottom and use display: inline-block and vertical-align: baseline;. Also, in this case, you need to get rid of any space in the HTML between the inner divs (newline).

    Like this (you can see the demo at http://dabblet.com/gist/2779082 ):

    HTML

    <div class="graph">
            <div style="height: 22px;" class="bar"></div><!--
            --><div style="height: 11px;" class="bar"></div><!--
            --><div style="height: 6px;" class="bar"></div><!--
            --><div style="height: 49px;" class="bar"></div><!--
            --><div style="height: 28px;" class="bar"></div>
    </div>
    

    CSS

    .graph {
        width: 50px;
        height: 50px;
        border: 1px solid #aeaeae;
        background-color: #eaeaea;
    }
    .bar {
        width: 8px;
        margin: 1px;
        display: inline-block;
        position: relative;
        background-color: #aeaeae;
        vertical-align: baseline;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some very basic semaphore code that works great on Linux, but cannot
I have some very basic SignalR code running on the js client: var conn
I have a very basic slideshow cycling some div containers. This is my code:
I have a very basic model - User I am trying to do some
I have some VERY simple code to return the title for a section header:
I have the following code in specman: var x := some.very.long.path.to.a.variable.in.another.struct; while (x ==
Good Afternoon, I have some very basic questions on GUI Event Handling. Firstly with
In it's very basic form I have a WebClient request for some xml in
I have a very basic function which I am using jQuery to slide some
I have some very simple XML: <properties> <property> <name>BobFish</name> <explaination>Bob is a fish.</explaination> </property>

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.