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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:37:13+00:00 2026-06-07T18:37:13+00:00

I have put together an example bit of code as I am trying to

  • 0

I have put together an example bit of code as I am trying to get 2 images of different sizes to be aligned at the top such as shown below:

HTML

<div id="test">
    <div class="social-media">
        <img src="http://www.ok.gov/ltgovernor/images/Facebook-icon.png" width="120"/>
        <img src="http://semanticweb.com/files/2012/01/twitter_logo.jpg" width="50" />
    </div>
</div>

CSS

test {
width:980px;
margin-left:auto;
margin-right:auto;
position:relative;
}

.social-media {
position:absolute;
background-color:#000;
right:0;
top:0;
vertical-align:top !important;
}

I realise now after reading a few posts online that vertical-align will not work in divs and solutions have been to use absolute positioning instead. The only issue is that I am already using absolute postioning for the images parent div.

Would it be good practice to do absolutes inside a parent div that is also an absolute.

However if i was to put an absolute positiong on the img then all img’s would stack ontop of each other unless I was to specify each and every img with a class.

So my next thought was to put a float on img within the div. I just wanted to know if this is good practice or if anyone can tell me a cleaner way of doing this?


Also, if I were to want the images to be centrally aligned, how would this be done as the float method works in the sense of getting the images to align at the top but I am not sure how I could align centrally or maybe at the bottom?

  • 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-07T18:37:14+00:00Added an answer on June 7, 2026 at 6:37 pm

    Put overflow:auto on the social-media div then add float:left to your images.

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

Sidebar

Related Questions

I have MANY small Test Projects where I put together just enough code to
I am trying to understand the Python ctypes module. I have put together a
I have put together an example page detailing my problem My website is going
I have put together a small example here just to replicate the problem. I
I'm trying to put an example together of using Caliburn Micro on WP7 with
I have an HTML form based questionnaire I am trying to put together. I
I'm trying to put together a small thumbnail gallery and have run into a
I have put together a navigation bar which expands a submenu on hover. See
I have put together a .net winform application which consumes a wcf service exposed
I have put together an API that responds to a POST request by putting

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.