Jump to content

how to add css styles to html elements using javascript ?


linux1880

Recommended Posts

elementObject.style  //This is how you tell an elementObject its going to be styled in CSS

 

elementObject.style.color='white';// OR ='#ffffff';

elementObject.style.backgroundColor='red';// OR ='#800000';

elementObject.style.padding=5;

elementObject.style.textAlign='center';

 

hopefully thats enough examples for you to understand it.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.