Trying to include a variable in my jquery:
var width = $(this).width();
$("#dynamic").html(".dropdown-bottom:before{left:'width'px;}");
How do I indicate that width is a variable in the .html?
Concatenate the strings together:
var width = $(this).width();
$("#dynamic").html(".dropdown-bottom:before{left:" + width + "px;}");
To subtract from your width, do so before the concatenation:
var width = $(this).width() - 20;
Since the documentation indicates that width() returns an integer, a simple subtraction should work here. This is of course presuming that this is actually referencing the correct thing.