When working on my Jquery program, I encountered an issue with borders not aligning properly within the container. Specifically, in the execution (where the container is represented by a white box), the left border extends beyond the position().left
property of my container and the right border does not extend far enough based on
$(".container").position().left()+$(".container").width()
I am wondering if this problem might be related to the structure of my basic HTML layout:
<html>
<body>
<div class ="main">
<div class = "container></div>
</div>
</body>
</html>
In this setup, the position of 'main' is set to static
, while the position of 'container' is set to absolute
. Additionally, the entire HTML document has margin: 0;
applied. Any suggestions on how I can adjust the left positioning to ensure it aligns correctly with the visual left border?