:before and :after

  • Opera 5: Text works, image doesn't.
  • Netscape 6 and Opera 7: Works.
  • Safari: Works, except that the :after text for the paragraph is placed below it (outside the paragraph).
  •  

    This is a test of :before and :after, with which you can place text or an image before and after each HTML element.

    Note that the content declaration must be the last one!

    Test

    Testsheet:

    p.test:before {content: url(../js/pix/logo_nn5.gif);}
    p.test:after {content: " and some text after";
    	color: #cc0000;}
    a:after {content: " after the A!"}
    

    Test paragraph width CLASS="test".

    And an a element to which should be added a text.

    Contents