<div position=relative>是什么的相对位置

div position=relative是相对于上一个div的左上角还是左下角??
2025-03-18 23:24:12
推荐回答(4个)
回答1:

position=relative 就是说声明一个固定的位,并不是说相对于上一个div的左上角还是左下角,想要相对于上一个div的左上角还是左下角,就得这样写

回答2:

是相对对齐的意思,出现在"文档流"里他该出现的位置,1,2,3,4,5他是5,那他就在5那个位置,加个top:200;就是出现在距5下200的地方,以他该在的位置“5”为参照。

这是html里的用法;行内用法,目前可以这样写,严格xhtml及以后的网页发展都不允许这样写了.
这是行内的用法

回答3:

static Default. The element is positioned according to the normal flow of the page. The Top and Left attributes are ignored. If the object is anchored inline, which only happens in Microsoft Word, this value is used.
absolute The element is positioned relative to the parent, using the Top and Left attributes. This value is used by Microsoft Word and Microsoft Excel floating objects, and Microsoft PowerPoint slides.
relative The element is positioned according to the normal flow of the page, but the Top and Left attributes are used. The overlap of overlapping elements is governed by the Z-Index attribute.

回答4:



该DIV相对于上面那个DIV aaaaaa位置




body td都同理。