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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:17:23+00:00 2026-05-13T15:17:23+00:00

I have this nightmare of code, <div style=height:46px;> <div style=text-align:left;float:left;> <img alt=Document Logo src=Images/img1.gif></img>

  • 0

I have this nightmare of code,

 <div style="height:46px;">
    <div style="text-align:left;float:left;">
      <img alt="Document Logo" src="Images/img1.gif"></img>
    </div>
    <div style="text-align:left;float:left;margin-top:5px;margin-left:13px;">
      <font size="4">
        <b>title (needs to be align to the left,next to img1)</b>
      </font>
    </div>
    <div style="text-align:right;float:right;vertical-align:top;">
      <img alt="Logo" src="Images/img.jpg"/>
    </div>
   </div>

img1 and title needs to be align to the left and img2 needs to be align to the right, but when I resize window img2 goes under title.

I need them all to remain in one line.

Can anybody give a hand?

Thanks in advance.

  • 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-13T15:17:23+00:00Added an answer on May 13, 2026 at 3:17 pm

    Another solution is to use absolute positioning instead of floats. Like so:

    <div style="position:relative; height:46px;">
        <div style="position:absolute; top:0; left:0; width:50px">
            <img alt="Document Logo" src="Images/img1.gif" width="50"></img>
        </div>
        <div style="position:absolute; top:5px; left:63px;">
            <font size="4">
            <b>title (needs to be align to the left,next to img1)</b>
            </font>
        </div>
        <div style="position:absolute; top:0; right:0;">
            <img alt="Logo" src="Images/img.jpg"/>
        </div>
    </div>
    

    Things to not about the above code:

    1. Make sure the first div has a width the same size as the image within.
    2. The second div should have a “left” of: width of first div + 13 (your margin-left)
    3. The second div has a top of 5 (your margin-top)
    4. You could get a little more fancy by specifying a “right” on the second div. This would help ensure the title and 3rd div/image do not ever overlap.
    5. I left the inline styles in for brevity, but please make them external (via classes or ids)
    6. Get rid of the FONT tag entirely if you can.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a nightmare trying to do this. I must have tried about 15
I have the following code and it is the nightmare that I feared when
This may seem like an unusual request, but does anyone have T-SQL (MSSQL2008) code
I have used Style Cop for making sure people follow set code standards before
This error is a nightmare, I have not been able to figure out why
I have a HtmlHelper which is used to output some accordion style functionality. This
Have this query: SELECT HOUR( DATE ) AS hr, COUNT( * ) AS cnt
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have this string 2012-06-27 16:17:06 and I want to convert it to GMT
I have this application where I implement the ActionBar Fragment interface. Underlying the interface,

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.