css - How do I center an absolute-positioned image with percentage width? -
i have image following css:
element.style { right: 50%; margin-right: -220px; top: 31%; width: 440px; position: absolute; }
i need change width set in percent instead(35.4%). can still center , keep position absolute?
of course, if want same way above use 35.4/2 = 17.7
margin (demo):
element.style { right: 50%; margin-right: -17.7%; top: 31%; width: 35.4%; position: absolute; }
Comments
Post a Comment