English 中文(简体)
如何用结构风格来打碎粉
原标题:how can I add styles of structure to jquery plugin

我只写了一张 j花板,使表格上的运作(如电网 p)。

彩虹添加了一些风格,例如overflow:hidden;到桌边和囚室的囚室和边界上(为了在穿制服的边界上保持距离,我补充说:。 MyTable{ Border-width:0 0 1px 1px;}。 MyTable > tr > td{ Border-width:1px 1px 0 }

Now I am wonder how and where to put this css styles.
I can put them on external css file but then I force the user to add .css file to her page. In order to make the plugin accessable to all users, even the new ones, this could be an obstacle. A user might forget to add the css file or even change it s content in order to achieve something and this will make the plugin work unproperly.
In addition, I want to let the user the ability to change things (like the border s width). In case I put the css on external file, the user can change anything she desires by herself.

另一种选择是,我也可以直接在酋长院(使用长官......指挥)上指定风格。 因此,用户不必处理文件,以便以适当的方式开展工作,以便改变风格(如边界),我可以给假想增加一个选择。 但这样,我就制定不有效的守则,我把行为与设计结合起来。

Is there any other possibility to add styles to jquery plugins?
What is the best way to do it?

I am NOT talking about a style that should determine color or font, but styles that are necessary to the structure I make!

最佳回答

您可在网页上添加一个<代码><上版”;要素。 与此类似:

$( <style>body { background-color: red; color: white; }</style> ).appendTo( head );

The above example is just one of many ways you can create DOM elements on-the-fly.

此外,这里还有试图做类似事情的人(尽管出于所有错误原因):

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签