Comments on: background-position https://css-tricks.com Tips, Tricks, and Techniques on using Cascading Style Sheets. Wed, 02 Jun 2021 19:19:50 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Hassan https://css-tricks.com/almanac/properties/b/background-position/#comment-1768819 Sat, 20 Feb 2021 06:38:54 +0000 http://css-tricks.com/?page_id=196146#comment-1768819 In reply to Swagato Bhatta.

Can someone explain to me this:
When I use pure pixel value like 10px 20px, it works fine,the picture actually move within container, but when I use parcentage values like 50% 20% the picture doesn’t move within container, the same phenomenon occur when I use four values like right 30px left 35px and also when I use top right(actually it shows me the top right part of an image).
Any help would be greatly appreciated.

]]>
By: sange https://css-tricks.com/almanac/properties/b/background-position/#comment-1755197 Sat, 21 Mar 2020 03:12:11 +0000 http://css-tricks.com/?page_id=196146#comment-1755197 If setting background-size: 200% 200%, then the background position value will be doubled ?

]]>
By: yichao https://css-tricks.com/almanac/properties/b/background-position/#comment-1750860 Sat, 17 Aug 2019 07:18:34 +0000 http://css-tricks.com/?page_id=196146#comment-1750860 In reply to Christian Solorzano.

20px 50%

]]>
By: Mohnish https://css-tricks.com/almanac/properties/b/background-position/#comment-1651995 Thu, 06 Sep 2018 05:06:27 +0000 http://css-tricks.com/?page_id=196146#comment-1651995 Can I use negative percentage? like background-position-y: -20%
Is it is recommendable or do we have any other alternatives? Please suggest

]]>
By: Daniel David https://css-tricks.com/almanac/properties/b/background-position/#comment-1621329 Sun, 15 Apr 2018 09:12:58 +0000 http://css-tricks.com/?page_id=196146#comment-1621329 Note: As of Chrome 66 – three-part syntax for background-positions are being deprecated due to parsing ambiguities … see here and [here] (https://drafts.csswg.org/css-values-4/#ref-for-propdef-background-position%E2%91%A0). So If I understand correctly: background-position: right 45px bottom; will have to be changed to background-position: right 45px bottom 0;

]]>
By: Fazilat Anjum https://css-tricks.com/almanac/properties/b/background-position/#comment-1616616 Tue, 27 Feb 2018 09:33:33 +0000 http://css-tricks.com/?page_id=196146#comment-1616616 why doesn’t support safari browser “background-position: right 8px top 14px;”

]]>
By: James https://css-tricks.com/almanac/properties/b/background-position/#comment-1613496 Sun, 03 Dec 2017 00:06:31 +0000 http://css-tricks.com/?page_id=196146#comment-1613496 you can use negative integers

]]>
By: Bernie https://css-tricks.com/almanac/properties/b/background-position/#comment-1604103 Wed, 14 Sep 2016 09:51:47 +0000 http://css-tricks.com/?page_id=196146#comment-1604103 In reply to Christian Solorzano.

This works for me:

background-position: right 20px top 50%;

]]>
By: ji https://css-tricks.com/almanac/properties/b/background-position/#comment-1600199 Sun, 13 Mar 2016 23:13:48 +0000 http://css-tricks.com/?page_id=196146#comment-1600199 12

]]>
By: Kevin Gibson https://css-tricks.com/almanac/properties/b/background-position/#comment-1597873 Mon, 09 Nov 2015 09:30:07 +0000 http://css-tricks.com/?page_id=196146#comment-1597873 In reply to Christian Solorzano.

How about ‘left 50% 20px’?

]]>
By: Swagato Bhatta https://css-tricks.com/almanac/properties/b/background-position/#comment-1597492 Thu, 15 Oct 2015 00:54:43 +0000 http://css-tricks.com/?page_id=196146#comment-1597492 Is there any best practice to use or not to use Keywords vs percentage?

]]>
By: Christian Solorzano https://css-tricks.com/almanac/properties/b/background-position/#comment-1596254 Mon, 03 Aug 2015 19:12:08 +0000 http://css-tricks.com/?page_id=196146#comment-1596254 What if I want the image to be centered right with some margin-right of about 20px?

How can I accomplish that?

]]>
By: Suyog https://css-tricks.com/almanac/properties/b/background-position/#comment-1596060 Fri, 24 Jul 2015 08:16:07 +0000 http://css-tricks.com/?page_id=196146#comment-1596060 thank you so much. You made my day !

]]>