html
<div id="mydiv"></div>
I want to add HTML code into this div (see following result I want) using ONLY CSS
<div id="mydiv"><a href="#">Lorem</a></div>
I think :after and :before are not helpful here!
html
<div id="mydiv"></div>
I want to add HTML code into this div (see following result I want) using ONLY CSS
<div id="mydiv"><a href="#">Lorem</a></div>
I think :after and :before are not helpful here!
CSS is not HTML. It is not possible to achieve that as CSS is not a markup language.
Just to add you can add content but not the element using :before or :after pseudo-element. Refer the specs
You can use content (just for text) in a couple of browsers but it's a really bad idea. Please solve this differently e.g. with Javascript, you'll need to for HTML anyway.