Understanding Inline-Level Elements
Description
inline
value creates inline-level elements, which are displayed without
adding line break before and after the element
Example
The following code changes p element to be an inline element.
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
p {<!--from w w w . j a v a 2 s .co m-->
display: inline;
}
span {
display: inline;
border: medium double black;
margin: 2em;
width: 10em;
height: 2em;
}
</style>
</head>
<body>
<p>This is a test.</p>
<p>This is a test. <span>This is a test.</span>
This is a test.
</p>
</body>
</html>
When using the inline value, the browser will ignore certain properties, such as width, height, and margin. All three properties are defined for span in the code, are ignored by the browser.