How can I insert text before an item with CSS? How can I insert text before an item with CSS? xml xml

How can I insert text before an item with CSS?


:before is a pseudo-selector itself, so it needs its own style block, like below:

project:before {  content:"Projekt:";}project {  display: block;  margin-bottom: 30pt;  margin-left: 0;}

fiddle: http://jsfiddle.net/wNEt3/

fiddle using your xml and css: http://jsfiddle.net/pRwMT/1/

Btw, http://htmldog.com/ is a great place to go for HTML & CSS tutorials, and they kindly point out W3schools inconsistencies, if you've visited there first :D


use z-index , z-index Only Work with position: fixed,relative,absolute:

project:before {  width:100%;  height:100%;  position:absolute;  content:"";  z-index:-2;}project {  position:relative;  display: block;  z-index:30;}

or:

project:before {  width:100%;  height:100%;  position:relative;  content:"";  z-index:-2;}project {  display: block;  z-index:30;}

documention : https://www.w3schools.com/cssref/pr_pos_z-index.asp