0

如果我使用 jquery 循环,我无法将文本居中,请帮助!

    <!-- Cycle Script -->
<script type="text/javascript">
    $(document).ready(function() {

        $("#text").cycle({
            fx: 'fade',
            pause: 1
        });

    });
</script>

<style>

#price2 { 
    text-align:center;
    width: 965;
    height:36px;
}

</style>

<div id="text">
  <p>text 1</p>
  <p>text 2</p>
  <p>text 3</p>
</div>
4

1 回答 1

1

为您的 p 标签指定宽度,如下所示:

#text { 
    text-align:center;
    height:36px;
}
p {
    width: 965px;
}
于 2011-06-01T17:34:37.307 回答