How to ignore borders when positioning any element ? | Sololearn: Learn to code for FREE!

+10

How to ignore borders when positioning any element ?

for example - I have an image with img{ position: absolute; left:10%; border:10px solid black; height:80%; width:80%; } I want the image in the center no matter if the border is removed or the width of the border has been changed (ignore the borders) .

3/11/2017 9:54:44 AM

Utkαrsh

7 Answers

New Answer

+9

box-sizing:border-box; box-sizing:content-box; could help you https://www.w3schools.com/cssref/css3_pr_box-sizing.asp experiment with this on your own, because I know you're pro so I won't tell you everything :)

+8

@Utkarsh nicee bro i can't wait!!👌👌 a new code?😁

+8

The code is here. Check out (Image Editor)🖼

+6

you can use <center> tag in html by put your image between this tag or you can use margin-left in css to be the image in the center.

+6

@kamil that worked perfectly .. you will soon find why I asked this question for 😉

0

align="center" and body{ position=0; padding=0; }

0

استایل بده به عکس <img src="/" style="margin:100px auto 0 auto"> <عکس منبع="/" استایل="فاصله:از بالا از راست از پایین از چپ"> اینم سورس با تحلیل