CSS Property Value How to - last-child; Add pipeline between page numbers in pagination control








Question

We would like to know how to last-child; Add pipeline between page numbers in pagination control.

Answer


<!--from ww  w.  j  a  v a  2 s.com-->
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
a:after, span:after {
  content: " |"
}

a:last-child:after {
  content: ""
}
</style>
</head>
<body>
  <a>Previous</a>
  <a>1</a>
  <a>2</a>
  <a>3</a>
  <span>4</span>
  <a>5</a>
  <a>6</a>
  <a>Next</a>
</body>
</html>

The code above is rendered as follows: