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

The Archive Base Latest Questions

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

In IE6, display:block with a colored background color extends that color to the far

  • 0

In IE6, display:block with a colored background color extends that color to the far right side of the page. Changing to display:inline fixes that problem, but the color now ends immediately after my last character, despite the fact that I have specified padding-right: 1em
in the CSS. padding-left is working, but not padding-right. Any workarounds? I have been googling for hours and cannot find an answer.

  • 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-13T10:17:58+00:00Added an answer on May 13, 2026 at 10:17 am

    I would hope display:block and display:inline work that way in other browsers too, not just IE6, since that’s how they’re meant to work. Block elements take up the full width (unless you specify a width yourself, in which case it will be that width) and have a newline afterwards, whereas inline only takes up the width it needs (even if you give it a different width, it won’t use it) and has no new line. This is why the background colour extends to the far right of the page when it’s a block element.

    Padding should work fine on an inline element, so it’s possible you have another element or style which is conflicting and causing the issue. Without seeing a code sample it’s impossible to tell.

    You could try using display:inline-block will keep the element inline (so that it doesn’t take up a full line and have a line break) but it will behave as a block element with regards to padding, margins and widths.

    Note though that IE6 (and 7) only allow display:inline-block on elements that are default inline elements (span, etc)

    Failing that, you would need to provide a code example that reproduces the problem so we can see if something else is having an impact.

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

Sidebar

Related Questions

How come when I have a div style at display: block; float: right, in
Suppose I want to set the display property of a div to inline-block. In
Sometimes in a floated div. IE6 does not display tags, however it does space
Given IE6, an UL-LI list and a background image for the UL container. <style>
I have a block level element which I am centering on the page. I
Working on this page: http://www.karlsenner.dreamhosters.com/about.php and having trouble with the navigation in IE6. It
My HTML+CSS graphic My issue with this page is that the High School, Middle
I have a HTML page where I have to display a popup (like tool
here is the page : http://pfibco.ca/01-accueil-fra.php I try to block hover highlight the menu...
I need to achieve something like this: <a style=display:block; href=#> <div style=float:left;display:block;>Left</div> <div> <div

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.