I'm trying to add a label to some existing styles that I have to display code on my page using the ::after pseudo-tag, but I can't seem to position it correctly,
I'm basing it on the "Label blocks of code with the language it is in" example from and looking for it to look like the following image from that page
It should be :
1. top right of the container attached to (in this case one of more <p> tags on the page)
2. only present if the Attribute is provided - rather than the box appearing with no content.
What I have at present is :
used as follows :
in the sample above, only the first "code" styled element should have the change.
Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
I'm basing it on the "Label blocks of code with the language it is in" example from and looking for it to look like the following image from that page
It should be :
1. top right of the container attached to (in this case one of more <p> tags on the page)
2. only present if the Attribute is provided - rather than the box appearing with no content.
What I have at present is :
CSS:
.code{font-family:arial,verdana,"times new roman",courier,helvetica,sans-serif;}
.code:after{content:attr(codelang);top:22px;right:2px;border:red 2px solid}
used as follows :
HTML:
<p class="code" codelang="Javascript">
function add(a,b)
{
[indent]return a+b[/indent]
}
</p>
The above snippet shows some <span class="code">Javascript</a> code and the following snippet is the same function in OScript :
<p class="code">
function add(integer a, integer b)
[indent]return a+b[/indent]
end
</p>
in the sample above, only the first "code" styled element should have the change.
Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006