issues editing CSS

palaci / 2017-10-09 09:40:52   

Hey there, i've been looking around threads here and I can't seem to find my problem.

i'm trying to modify my style.css file with some simple codes and when calling them back in html it never works.

here is the code i've writed down in css ( i would like to have some text positioned randomly in my page each time it loads ) : .var options = {

margin: {
min: 0,
max: 60,
unit: 'px'
}

}

function getRandomInt (min, max, unit) {
return Math.floor(Math.random() * (max - min + 1)) + min + unit;
}
function randomize() {
var posts = document.getElementsByClassName("randommm");
for (var p = 0; p < posts.length; p++) {
posts[p].style.margin = getRandomInt(options.margin.min,options.margin.max, options.margin.unit) + " " + getRandomInt(options.margin.min,options.margin.max, options.margin.unit);

}
}

randomize();

when i call it with a nothing happen.

even with simpler css like this : .bloc-gauche {
float:left;
width:70px;
color:#A0A0A0;
border-right:solid 1px;
padding-right:8px;
}

it's still not working, or kinda working...
the page i'm working in is : hugomaillard.online/index.php/un-campement/

can you please help me ?

thank you

palaci / 2017-10-09 09:53:54   

for example i have this working here jsfiddle.net/5mvKE/698/

how can i make it work on my website ?

This thread has been closed, thank you.