Inline-Level Elements

inline-level elements create an element box within a line and do not break up the flow.

The following code changes p to be inline.

 
<!DOCTYPE HTML> 
<html> 
    <head> 
        <title>Example</title> 
        <style type="text/css"> 
            p { 
                display: inline; 
            } 
            span { 
                display: inline; 
                border: medium double black; 
                margin: 2em; 
                width: 10em; 
                height: 2em; 
            } 
        </style> 
    </head> 
    <body> 
        <p> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
        <p> 
            HyperText Markup Language (HTML) is the main markup language for 
            displaying web pages and other information that can be displayed 
            in a web browser(From From Wikipedia, the free encyclopedia).
        </p> 
    </body> 
</html>
  
Click to view the demo
Home 
  HTML CSS Book 
    CSS  

display:
  1. Block-Level Elements
  2. Inline-Level Elements
  3. inline-block
  4. Run-In Elements
  5. Hiding Elements
Related: