css - Get offsetLeft of pseudo elements using javascript -
is there way offsetleft of pseudo element using javascript ?
i able inspect ::before element through chrome devtools console , offsetleft.
as window.getcomputedstyle(elem, ':before') gives computed styles ::before, there similar access offsetleft ?
yes, can computed style pseudo element, left value of it's bounding box:
parseint(window.getcomputedstyle(elem, ':before').getboundingclientrect().left, 10);
Comments
Post a Comment