2008-12-30 17 views

回答

3

CSS:

.answerbox 
{ 
height: 150px; /*Specify Height*/ 
width: 150px; /*Specify Width*/ 
border: 1px solid black; /*Add 1px solid border, use any color you want*/ 
background-color: green; /*Add a background color to the box*/ 
text-align:center; /*Align the text to the center*/ 
} 

HTML: <div class="answerbox">4 <br /> Answers</div>

3

使用任何元素 - 例如,一個div,確保它顯示爲一個塊級元素(即display: block)並給它一個邊界。

.box { border: 1px solid #088; font-size: 4em; } 

<div class="box">6</div> 

工作的很好。

8

使用Firebug和 「檢查」 功能;指向SO的答案框,然後從Firebug控制檯翻錄HTML和CSS。

+0

感謝您的提示:) – 2008-12-30 15:03:56

相關問題