2008-12-30 15 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

相关问题