HTML and CSS Reference
In-Depth Information
level boxes may wrap</span> around more
than one line if the layout requires them to.
And the CSS is as follows:
.box {
border:2px solid black;
Setting box type
The type of box used is not set in stone. In fact, there is a CSS property called display
for setting the type of box an element is contained in. Setting display:block on
an element will treat it as being contained in a block-level box, while setting dis-
play:inline will treat it as being contained in an inline-level box. Having the ability
to swap between box types is particularly useful with anchor elements ( a ), which are
inline-level elements by default, so they ignore width and height settings.
Consider the following HTML:
<a href="#">Link</a>
<a href="#" class="block">Link</a>
The preceding code could be styled with the following CSS:
a {
/* set the width */
/* set the height */
border:1px solid #000;
/* set a black border
/* set a gray back-
ground */
/* set 10 pixels of
padding */
/* remove the under-
line */
/* center align the
text */
/* add margin to the
Search WWH ::

Custom Search