Dynamically add css to page via javascript

前端 未结 5 1552
旧巷少年郎
旧巷少年郎 2020-12-04 16:33

I\'m making a widget that will be added to external websites, and I have made a page that generates css for them to style it (text color, background color, font size, etc).

5条回答
  •  臣服心动
    2020-12-04 17:06

    I recommend you start using a decent framework for your web/JavaScript development, personally I'd go with jQuery.

    http://api.jquery.com/css/
    

    There are some code snippets here that show you how to quickly set css properties for elements.

提交回复
热议问题