How can you insert a variable into a string?

How can you insert a variable into a string?

Hi, I am trying to change the css values of a html element the width, height, left and top values.

I want them to be variable. So depending on which element is selected. It would change these values.

For example: Here is the concept which will be explained in a function:

function reposition(element){
get elements top and left value
then get the width value
then get height value.

top minus height  =  new top position for div.

wrap div  around element now.
}

The div will be a handler for that element to be draggable. 

So I need to know how I can insert what's in my values into the css values. 

for example if the variable bob is 20. 

I want to be able to put  css top = 20        but like this css top = bob. 

So what I am saying that I want to type it like this  css top = bob    but want the code to show 20 instead of bob. 

Yet currently it's like a string so it's saying bob instead of 20.  So I am getting css errors.

this is not actual code. It's just concept. 

I just want to be able to insert what is stored in a variable into the css  values.