0

what is the difference between ABSOLUTE and RELATIVE in HTML?

21st Jun 2017, 4:08 AM
Ivan Marcial Villarosa
Ivan Marcial Villarosa - avatar
7 Respostas
+ 3
@Andrew you're right. the part about sizing is correct though. didn't think the positioning through.
21st Jun 2017, 5:32 AM
Mario L.
Mario L. - avatar
+ 3
@Maad no, they won't appear next to each other, because p and h1 are block elements. they're in separate lines.
21st Jun 2017, 5:56 AM
Mario L.
Mario L. - avatar
+ 2
absolute path: http://www.example.com/your/path/here/index.html relative path: your/path/index.html the second one starts from the document you're currently at. absolute position/size: something in px relative: something in % values in % are relative to the browser's standard sizing or relative to what you defined before or relative to the patent element.
21st Jun 2017, 4:33 AM
Mario L.
Mario L. - avatar
+ 1
Ive encountered absolute and relative in positioning using css back when I created my first website, yet I still cant completely understand how it works. But your answer did help me, get an idea, i'll get there. Thanks Mario.
21st Jun 2017, 4:37 AM
Ivan Marcial Villarosa
Ivan Marcial Villarosa - avatar
0
relative is like a /anyfolder. and absolute like whole complete address.. like https://www.envie.tech/anyfolder. if u want to let the site working on every different domain name u can do that... but if u chnge the base ur that is http://www.envie.tech . then u will unable to view or u can't be able to. chnge ur files locations
21st Jun 2017, 4:52 AM
Sudhanshu Prajapati
Sudhanshu Prajapati - avatar
0
Example: h1 p{ position:relative; left:10px; } now when you write this code for html <p>hello</p> <h1>Adam</h1> The resulte is: hellow Adam now Adam after hello became 10px that mean in relative aftar last code here last code before code <h1> is <p> but in absolute he write Adam aftar 10px from begain page and Adam be above hello because them have same left postion in css Ihope understand this
21st Jun 2017, 5:43 AM
Maad Ahmed Naem