2012-02-14 118 views
0

我在使用這個fancy JQuery plugin開發的基於網絡的應用程序中放了一些引號和短消息。一切正常,但現在的問題是修復顯示報價或消息的區域。我想要有一個固定的高度這個區域,而不是可擴展的。如何修復該區域的高度?

如何做到這一點?

HTML:

<div id="wrapper"> 
      <div id="article"> 

       <blockquote> 
        <p>Accidents hurt – safety doesn’t.</p> 
        <cite>&ndash; Unknown Author</cite> 
       </blockquote> 
        </div> 
</div> 

CSS:

#wrapper { width: 300px; margin: 1px auto; }  
blockquote p { margin-bottom: 10px; font-style: italic; } 
blockquote cite { font-style: normal; display: block; text-align: right; text-transform: uppercase; font-size: 10px; font-weight: bold; letter-spacing: 1px; font-family: Arial, Helvetica, sans-serif; } 

/* 
| Setting the width for the blockquotes is required 
| to accurately adjust it's contianer 
*/ 

blockquote { 
    font-family: Georgia, Times, serif; 
    width: 250px; /* required */ 
    margin: 0 auto; 
    } 

/* 
| The #quote_wrap div is created 
| by Quovolver to wrap the quotes 
*/ 

#quote_wrap { 
    background: #fbffec 20px 20px; 
    margin: 13px 0 0 0; 
    padding: 20px; 
    border: 1px solid #edffaf; 
    } 

的JavaScript:

<script type="text/javascript" src="js/jquery.quovolver.js"></script> 

     <!-- JavaScript Test Zone --> 
     <script type="text/javascript"> 
      $(document).ready(function() { 

       $('blockquote').quovolver(); 

      }); 
     </script> 

編輯: 我想是因爲修復,如果我有很長的郵件或報價,它將會擴大,這將導致如圖所示擴大網站的頁面elow: enter image description here

如果消息是短暫的,以下區域會是這樣?: enter image description here

新更新:

以下CSS屬性固定的問題:

height:100px!important; 

但現在它擾亂了框內的報價組織。例如,如果短消息,它將在框的頂部。如果它很長,它將被集中,這就是我想要的所有消息,無論它是長還是短。 那麼該怎麼做?

+0

只是好奇。這些評論是什麼? :P – PeeHaa 2012-02-14 10:45:17

+0

也好奇。你爲什麼要高度固定?有些盒子在盒子內部會有很多額外的空間(固定的高度)(除了內容總是足夠長的話可以創建一個滾動條),但這很奇怪。 – Joonas 2012-02-14 10:54:17

+0

查看編輯的問題請 – 2012-02-14 11:01:00

回答

1
.widget_content { 
height: 150px !important; /* Or however high you want the div to be */ 
} 

這將阻止div改變的高度,我認爲這是你的意思。

「150px」可以更改爲想要div的高度。

.widget_content { 
overflow: hidden; 
} 

這將切斷比你早指定高度不再有任何引用。 (如果你確保所有的報價都足夠小,以適應你之前指定的高度,你不應該需要這個,以防萬一)。

+0

我應該把它放在哪裏? – 2012-02-14 11:13:03

+0

在CSS樣式表中。它在哪裏並不重要。 – ACarter 2012-02-14 11:37:53

+0

感謝您的幫助。對此,我真的非常感激。但現在,我還有一個問題。你能否看到上面問題中的最新更新? – 2012-02-14 11:48:45