Position a CSS background image x pixels from the right

0 votes

I believe the answer is negative, however can you use CSS to place a background image so that it is a fixed distance from the right?

When I specify x and y values for background-position, it appears that they only give fixed pixel adjustments from the left and top, respectively.

Jun 9, 2022 in CSS by Edureka
• 13,620 points
702 views

1 answer to this question.

0 votes

The attribute border can be used as the length from the right.

background: url('/img.png') no-repeat right center;
border-right: 10px solid transparent;
answered Jun 10, 2022 by Edureka
• 12,690 points

Related Questions In CSS

0 votes
0 answers

Fading in a background image using javascript or css on hover

I have so far been able to ...READ MORE

Jun 30, 2022 in CSS by Edureka
• 13,620 points
880 views
0 votes
0 answers

Make a full screen CSS background image appear "behind" a mobile keyboard

I've set an HTML/CSS full-screen background image ...READ MORE

Jul 18, 2022 in CSS by Edureka
• 13,620 points
989 views
0 votes
0 answers

Placing an image to the top right corner - CSS

I need to retain the current text ...READ MORE

Aug 10, 2022 in CSS by Edureka
• 13,620 points
2,868 views
0 votes
1 answer

Is there any way to colorize a white PNG image with CSS only?

Filters can be used with -webkit-filter and ...READ MORE

answered May 27, 2022 in CSS by Edureka
• 12,690 points
1,512 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
9,624 views
0 votes
1 answer

Using/Handling colon inside a JSF generated HTML element ID in CSS selector

Yes, you can.  Just Backslash (\) the colon.  Like ...READ MORE

answered Nov 14, 2018 in Others by DataKing99
• 8,240 points
2,548 views
0 votes
1 answer

What is a css selector and where is it used?

CSS Selector is a combination of element ...READ MORE

answered Nov 21, 2018 in Data Analytics by Kalgi
• 52,360 points
684 views
0 votes
1 answer

How do I give text or an image a transparent background using CSS?

Use either a semi-transparent PNG or SVG ...READ MORE

answered May 27, 2022 in CSS by Edureka
• 12,690 points
385 views
0 votes
1 answer

CSS: Set a background color which is 50% of the width of the window

You can make a hard distinction instead ...READ MORE

answered Jun 28, 2022 in CSS by Edureka
• 12,690 points
3,217 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP