1
I created this FIDDLE to check if what I was doing was right or wrong. Apparently it’s wrong:
My goal here is Javascript assign values of CSS to an element of HTML, in this case the value top
.
I was basing my response on this problem which I found, but even I do not have the final result intended which was to put the div
100px
further down.
JAVASCRIPT
var altura = 100;
$("#footer").css("top", altura + "px");
HTML
<div id = "footer">
</div>
CSS
#footer {
height: 100px;
background-color: grey;
}
Is this what you want? -> http://jsfiddle.net/1Lghrq22/1/ in which case only the
position: relative;
for example– Sergio
that’s exactly what I want. Thank you
– msm.oliveira
@Sergio by the way.. what if I want to add more than one parameter? how do I do?
– msm.oliveira