Элементы эксплуатации и элементы позиционирования, использование JS для их реализации является хорошим выбором. Есть пример ниже. Друзья, которые это нужно, могут взглянуть на это.
<! Doctype html> <html> <Head> <meta http-equiv = "content-type" content = "text/html; charset = utf-8"/> <title> один экземпляр Javascript в день, направленное элементом позиционирования элемента </title> <style> div#a {width: 500px; } div {border: 1px solid #000; Заполнение: 10px; } #cursor {position: Absolute; фоновый цвет:#ff0; Ширина: 20px; Высота: 20px; Слева: 50px; Верх: 300px; } </style> <script> function positionObject (obj) {var rect = obj.getBoundingClientRect (); вернуть [rect.left, rect.top]; } window.onload = function () {var tst = document.documentelement.getBoundingClientRect (); оповещение (tst.top); var cont = 'a'; var cursor = document.getElementbyId ("cursor"); while (cont) {cont = reffice («Где вы хотите переместить блок курсора?», «a»); if (cont) {cont = cont.tolowercase (); if (продолжение == "a" || cont == "b" || cont == "c") {var elem = document.getElementById (продолжение); var pos = positionObject (elem); console.log (pos); cursor.setAttribute ("style", "top:"+pos [1]+"px;"+"слева:"+pos [0]+"px"); }}}}} </script> </head> <body> <div id = "a"> <p> a </p> <div id = "b"> <p> b </p> <div id = "c"> <p> c </p> </div> </div> </div> <div id = "cursor"> </div> </div> </div> </div> <div id = "