I'm positioning one html element absolute at i.e left:1000px. Now I want to place another div element directly in front of it at the left side. Using negative margin is not an option because I dont know the size of the element. Current solution is to use javascript, using hidden attribute until rendered, then get size using getBoundingClientRect() at then apply left: ob.style.left = -viewportOffset.width + "px";
Is there a css-grid trick or something I can take advantage of? Im using Blazor if that matters.
<div title=@ToolTipText class="@currentClass()" style="position:absolute;left:@left;top:@top;height:@height;width:@width;line-height:1;">
@Value
@if (!string.IsNullOrEmpty(Title))
{
<div class="@TitleFontScheme" style="position:absolute;line-height:1;background-color:transparent;" @ref="titleElement">@Title</div>
}
</div>