How can I draw a field using css like an answer field on stackoverflow?

How can I draw a field in css? I want a box, like green, to be used to display the number of answers for a question on stackoverflow?

+1


source to share


5 answers


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


source


Use Firebug and the "Inspect" function; specify in the answer box here on SO and strip the HTML and CSS from the Firebug console.



+8


source


Use any element - eg. a div

, make sure it displays as a block level element (i.e. display: block

) and gives it a border.

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

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

      

Works well.

+3


source


this page: http://www.w3.org/TR/CSS2/box.html

was the first page found in a google search for "css box"

0


source


You can also use the AIS Accessibility Toolbar - http://www.visionaustralia.org.au/ais/toolbar/ - to expose the CSS used for the site among all host other things.

0


source







All Articles