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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:33:22+00:00 2026-06-12T15:33:22+00:00

Consider this being slipped into some HTML file right after a <body> tag and

  • 0

Consider this being slipped into some HTML file right after a <body> tag and before some text:

<div style="width:100%; height=320pix; background-color:black">
<img src="logo.jpg">
</div>

For me, this creates a black “banner” at the top of the browser page, with the logo image (320pix high) aligned to the left. How can I move it to the right and leave the text exactly as is? I would like to know the simplest addition to this code to achieve that. When I specify style="float:right" in the <img ...> tag line, the text that follows wraps around it, destroying the banner effect.

However… if I transfer the same elements into a <style>...</style> block within the HTML, and include an img{float:right;} everything works fine. I just do not understand why the floating behaviour should be different between the two approaches. My head is about to explode…

A possible lead – This question indicates that it should be simple, but when I try precisely the code given, it still does not work. Could it be a !DOCTYPE or similar issue? I am using Firefox 15.0.1 as my browser.

  • 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-12T15:33:23+00:00Added an answer on June 12, 2026 at 3:33 pm

    Give the DIV containing the image a relative position. This will allow you to position the image absolutely within it.

    <div style="position:relative; width:100%; height:320px; background-color:black">
    
        <img src="logo.jpg" style="position:absolute; right:0px;">
    
    </div>
    

    Adjust the ‘right’ to position the image to your liking.

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

Sidebar

Related Questions

Consider this example: http://jsfiddle.net/treeface/P8JbW/ HTML : <div id=test> <img src=http://ycombinator.com/images/y18.gif /> </div> CSS :
Consider this problem: There's a square grid defined, each tile being either passable (1)
I might be being a bit thicky here but please answer me this. Consider
Consider this code in a php file on my VPS server: <?php $url =
Consider this piece of code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using
Consider this code: @tmp = split(/\s+/, apple banana cherry); $aref = \@tmp; Besides being
Consider this example, it shows two possible ways of lazy initialization. Except for being
Consider this C construct that checks for errors before doing actual work: int function(struct
Consider this sample code: <div class=containter id=ControlGroupDiv> <input onbeforeupdate=alert('bingo 0'); return false; onclick=alert('click 0');return
Consider this code: FILE * fp = fopen( filename, r ); int ret =

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.