2012-02-14 43 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