Insert the image before, and after <p> elements, using the ::before and ::after pseudo-elements. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Insert the image before, and after <p> elements, using the ::before and ::after pseudo-elements.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
p::before{<!--from  w w  w.ja v a  2s.c  o  m-->
    content: url(http://java2s.com/resources/d.png);
}
p::after{
    content: url(https://www.java2s.com/style/demo/Opera.png);
}
</style>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>

</body>
</html>

Related Tutorials