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

发布于 2024-12-09 16:58:26 字数 2107 浏览 0 评论 0原文

我正在尝试使用名为 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;
}

I am trying to use the jquery-ui widget called accordion to display two pieces of text to the user. As you can see in the screenshot the text is overlapping the arrow and I don't know why.

Screenshot

Here is my 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> 

Here is 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>

Also, I am having trouble changing the size of the header text. I tried this in my main.css but it doesn't work, only the font changes, not the size:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

荒路情人 2024-12-16 16:58:26

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

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

Janis Lankovskis answered this question in the comments. The solution was to do this in the CSS:

#accordion h3 { padding-left: 100px; }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文