I have realised this wont work because of these things “{” “.” or something, so I have been searching for other methods that refer to the stylesheet however they all don’t seem to work and I’m all out of a ideas.
The <<script>> macro does not run CSS, it runs JavaScript. I don’t think there’s any macro in SugarCube to add CSS to the stylesheet, but there are two things you can do.
Create a New CSS Class and use <<addclass>>
You could add a new CSS class to your stylesheet like so:
The first way is probably simpler for you and easier to write. The second way would mean you don’t have to add new classes to your story stylesheet everytime you want to do something new.
Hi, thanks for the reply however If I’m doing the first method right, it doesn’t work as it gives me the error "no elements matched the selector “img.car”.
Hey, I think it’s because I put the wrong selector there. “img.car” means “An image element with the class ‘car’.” Since car is your id, you use “img#car” which means “An image element with the id ‘car’.”
I misread your original post and thought you had “car” as the class on your image, not the id. I updated my original answer to use the # which means select by id.