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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:52:10+00:00 2026-06-14T17:52:10+00:00

I have the content set to 1024px width and aligned to the center. Now

  • 0

I have the content set to 1024px width and aligned to the center. Now I want a banner on the left side. Because the banner can be in different size I have to align the banner to the right side. The banner is wrapped with an anchor. In my example below I used a div instead of an image.

HTML:

<div id="content">
    <div id="banner">
        <a href="#"><div id="background">banner</div></a>
    </div>
    <div id="maincontent">      
        SSSSSSSSSSSSSSSSSSSSSSSSS
        OOOOOOOOOOOOOOOOOOOOOOOOO
        MMMMMMMMMMMMMMMMMMMMMMMMM
        EEEEEEEEEEEEEEEEEEEEEEEEEEE
        CCCCCCCCCCCCCCCCCCCCCCCCC
        OOOOOOOOOOOOOOO
        NNNNNNNNNNNNNNNNNNNNNNN
        TTTTTTTTTTTTTTTTTTTTT
        EEEEEEEEEEEEEEEEEEEEE
        NNNNNNNNNNNNNNNNNNNNNNNNNN
        TTTTTTTTT
    </div>
</div>

CSS:

#content {
  width: 400px;
  margin: 0 auto;    
  background-color: red;
  position: relative;
}

#background {
    width: 20px;
    height: 100px;    
    background-color: blue;
    color: white;
}

#banner{
    position: absolute;
    left: -200px;
    width: 200px;
    height: 100px;
    background-color: yellow;    
    text-align: right;
}

JSFiddle

text-align: right; doesn’t make the trick.

  • 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-14T17:52:11+00:00Added an answer on June 14, 2026 at 5:52 pm

    remove width: 20px from #background

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

Sidebar

Related Questions

I have some content set to be in 3 columns, but as it wraps
In my servlet I have the following code: response.setContentType(application/json);//set json content type PrintWriter out
I have a system set up to lock certain content in a database table
I have been asked to set up some authentication for some content on our
When you set an html element to have display: none , the content inside
OK I have backgrounds set up like this: HTML <div id=container> <div id=content> CONTENT
I have adsense for content set up for my site running on my blog.
I want my User Control to be able to have Literal Content inside of
Say I have a div that I want to be centered horizontally, and set
I have a tab content template set to my tab control: <TabControl SelectedIndex=0 ItemsSource={Binding

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.