I've been trying to set the relative width of an element using jQuery's width function, but it keeps adding 5% to whatever value I enter.
For example doing:
.width() method sets the width of the content of an element, not including
padding, you probably need
.outerWidth() method which includes
padding as well.
Another solution is to set
box-sizing: border-box; on your element, which forces
.width() method to include