为什么我的手风琴文字与箭头重叠?

时间:2011-10-11 05:30:43

标签: css jquery-ui

我正在尝试使用名为accordion的jquery-ui小部件向用户显示两段文本。正如您在屏幕截图中看到的那样,文本与箭头重叠,我不知道为什么。

Screenshot

这是我的HTML:

#{extends 'main.html' /}
#{set title:'Test A' /}

<div id="accordion">
    <h3>Alpha</h3>
    <div>
        Hi!
    </div>

    <h3>Beta</h3>
    <div>
        Lo!
    </div>
</div>

<script type="text/javascript" charset="utf-8">
    $(function() {
        $("#accordion").accordion({
            autoHeight: false,
            clearStyle: false
        });
    });
</script> 

这是main.html:

<!DOCTYPE html>

<html>
    <head>
        <title>#{get 'title' /}</title>
        <meta charset="${_response_encoding}">
        <link rel="stylesheet" media="screen" href="@{'/public/stylesheets/main.css'}">
        <link rel="stylesheet" type="text/css" media="screen" href="@{'public/stylesheets/ui-lightness/jquery-ui-1.8.16.custom.css'}" />
        <link href="http://fonts.googleapis.com/css?family=Ultra|Shanti" rel="stylesheet" type="text/css">
        #{get 'moreStyles' /}
        <link rel="shortcut icon" type="image/png" href="@{'/public/images/favicon.png'}">
        <script src="@{'/public/javascripts/jquery-1.6.4.min.js'}" type="text/javascript" charset="utf-8"></script>
        <script src="@{'/public/javascripts/jquery-ui-1.8.16.custom.min.js'}" type="text/javascript" charset="utf-8"></script>
        #{get 'moreScripts' /}
    </head>
    <body>
        <div id="wrap">
            <div id="main">
                #{doLayout /}
            </div>
        </div>
        <div id="footer">
            Some trifling words.
        </div>
    </body>
</html>

另外,我无法更改标题文本的大小。我在main.css中试过这个但是它不起作用,只有字体改变,而不是大小:

h3 {
    font-family: 'Ultra', Arial, serif;
    font-weight: 400;
    font-size: 20pt;
}

1 个答案:

答案 0 :(得分:3)

Janis Lankovskis在评论中回答了这个问题。解决方案是在CSS中执行此操作:

#accordion h3 { padding-left: 100px; }