HTML and CSS coding for inline-block elements : CSS Basics « Style Basics « HTML / CSS






HTML and CSS coding for inline-block elements

  
<!DOCTYPE html> 
<html> 
<head> 
<title></title> 
<style type="text/css"> 
#faq p.pad { display: inline-block; 
border: thin dotted; padding: 1px; 
font: bold small sans-serif; } 
#faq p.mad { position: relative; 
bottom: -1em; } 
</style> 
</head> 
<body> 
<div id="faq"> 
This is a test. This is a test.
<p class="pad">7 8 9<br/>4 5 6<br/>1 2 3</p> 
while the keys on a telephone are 
<p class="pad mad">1 2 3<br/>4 5 6<br/>7 8 9</p> is ... 
</div> 
</body> 
</html> 

   
    
  








Related examples in the same category

1.Using Whitespace in CSS
2.Cascaded
3.css box model
4.CSS Text Properties Example
5.Zero page gutter
6.Inline HTML elements include markup for explicit semantic purposes:
7.CSS can be used to control the presentation of an XHTML document
8.Box Model Demonstration
9.Width and height
10.Default Styles
11.horizontally stretching content
12.stretching content
13.Box model properties are always specified in order clockwise.
14.vertically stretching content
15.Update text color when mouse hover
16.Whitespace and Chunking
17.Multiple Columns