Friday, September 3, 2010

CSS :before, :after selectors

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Test paragraph with before and after selectors</title>

<style type="text/css">

p.test:before {
padding-right: 5px;
content: url(googleIcon.jpg);
}
p.test:after {
font-style: italic;
content: " and some text after.";
}

</style>

</head>

<body>

<p class="test">Test paragraph with </p>


</body>

</html>

No comments:

Post a Comment