官术网_书友最值得收藏!

Controlling spacing with themes

The space between accordion sections is controlled by the CSS theme framework. In particular, the visual structure for the accordion is defined by a set of CSS rules that can be modified to control the spacing between accordion sections. We could override the accordion theme CSS to adjust for more or less spacing between sections.

How to do it...

We're going to supply an additional CSS module to our UI—one that overrides the accordion structure supplied in the theme we happen to be using. There's no need to fret, however, our change is a simple one. We're going to update the margin-top property. In a new CSS file called theme.accordion.css, let's add the following style rules:

.ui-accordion .ui-accordion-header {
    margin-top: 4px;
}

Now that we have the CSS, we need to include it in our HTML header. It should look something like this:

How it works...

We're copying the same CSS selector as is found in any jQuery UI theme. The particular property we've just changed alters the space between the accordion sections. Since we're overriding the default theme value, it's important to include our CSS files after the default theme file. This allows us to override the default theme instead of the default theme overriding our modifications.

主站蜘蛛池模板: 衡水市| 阿城市| 武山县| 九台市| 凤台县| 桓仁| 庄浪县| 开封市| 慈溪市| 财经| 东安县| 东阳市| 龙胜| 枝江市| 阿尔山市| 都匀市| 峡江县| 竹北市| 鄂州市| 富源县| 辉南县| 潮安县| 北川| 新绛县| 巴彦县| 同江市| 原阳县| 武威市| 永宁县| 巴彦淖尔市| 金乡县| 古蔺县| 江川县| 钦州市| 上林县| 定日县| 乐至县| 开远市| 安陆市| 沽源县| 伊宁县|