简体   繁体   English

如何更改jQuery插件的CSS样式?

[英]How to change css styles of a jQuery plugin?

I have this test page: http://www.problemio.com/problems/problem.php?problem_id=305 我有此测试页: http : //www.problemio.com/problems/problem.php?problem_id=305

I am trying to make the form towards the middle of the page look nicer. 我正在尝试使页面中间的表单看起来更好。 When I look at it in FireBug, there is a lot of padding space on the sides of that tabs from this div: 当我在FireBug中查看它时,此div的选项卡的侧面有很多填充空间:

<div id="tabs-1" class="ui-tabs-panel ui-widget-content ui-corner-bottom">

How can I change the space padding on the sides of the divs to be less pixels? 如何将div两侧的空格填充更改为更少的像素? Also, is there a way to make the black strip across the tabs all black? 另外,有没有办法使标签上的黑色条带全部变黑?

Thanks! 谢谢!

You can override the css defined by jQuery UI css in your application css file or on the page. 您可以在应用程序css文件或页面中覆盖由jQuery UI css定义的css。 You can set the padding as below and override all the required styles in the same way. 您可以如下设置填充,并以相同的方式覆盖所有必需的样式。

.ui-tabs-panel{
   padding: 0px !important;//define the style as per your need
}

懒惰的方法是在CSS中设置重要属性。

#tabs-1{padding-left: some lesser value !important}

It looks like the padding is getting added because each form element is wrapped inside a paragraph <p> tag. 由于每个表单元素都包装在段落<p>标记内,因此似乎正在添加填充。 The style is applied to just the p element in your stylesheet, so you can overwrite it with the following: #add_suggested_solution p {margin:0 0 0 0} . 该样式仅应用于样式表中的p元素,因此可以使用以下#add_suggested_solution p {margin:0 0 0 0}覆盖它: #add_suggested_solution p {margin:0 0 0 0} Note, replace the 0's with whatever your desired margin is. 请注意,将0替换为所需的空白量。

What is the black stripe that you are referring to? 您指的是黑色条纹?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM