w3c / w3c/csswg-drafts

with the background-position property, where is the 50% position decision?

Open
#7,982 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Closed as Question Answered css-backgrounds-4
Dominant language
Bikeshed
Stars
4.9k
Forks
816
PR merge metrics
PR metrics pending

Description

in the following example an image created with background-image has an even width (4 pixels) .

It is placed in the middle (50%) of the div element containing it. This element has an odd size (9pixels).

result: the image has 3 pixels to its left and 2 to its right.
it could have been 2 pixels to its left and 3 to its right.

My question is not why. My question is where are the documents that specify this type of CSS decision?

image

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSS specification material covering background-image, background-position, and percentage positioning, using the two linked examples as the reproduction. Locate the normative text that explains how the midpoint is resolved for an even-sized image in an odd-sized container, then document or link that decision so the issue has a clear reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.