Forum Moderators: not2easy
<snip>
It's a TypePad site and I added custom styles for a redesign. The copyright line at the bottom is not part of the original HTML so I had to add it with CSS. Applying :after to the main container works good but I can't add anything other than plain text. No ©, no hyperlinks, and no url(copyright.html). It seems url only works for images, sounds and other media.
I have not found any discussion online on this topic. Does anyone have a solution?
Jeremy
<snip>
[edited by: swa66 at 6:43 am (utc) on Sep. 11, 2009]
[edit reason] No links nor singatures, please see ToS and Forum Charter [/edit]
You can add all kinds of stuff with :after, but you need to be especially watchful of IE support and be prepared to hack around some issues. :after has appropriate usage and maybe not so good choices as well. Like anything else, once widely adopted it will be used for good stuff and garbage uses as well.
I would need to be sold on using :after for copyright and giving up what I consider to be the greater power and flexibility of PHP includes.
You should familiarize yourself with generating :before and :after content. W3C- Generated Content [w3.org]
You can add content, CSS.... The © won't work. You must use the correct character reference and use escape correctly as well. That's why it is not working for you.
Links to inserted images are no problem with :after. Don't know about adding URLs though. You'd have to research that a bit.
The sample below works in FF and Opera, but does NOT work in IE7 (what I've got in front of me at the moment). You should be able search for some IE hacks easily enough. Don't have the IE.js here - that might fix it in a snap. Haven't tried it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title></title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
#footer {
color: blue; font-size: 1em; margin: 5em;
}
#footer:after {
content: "\"I want to add stuff.\" \00A9"; color: red; font-size: 1.3em; text-indent: 3em; display: inline-block;
}
</style>
</head>
<body>
<div id="footer">
Test
</div>
</body>
</html>
Does anyone know if you can add code in the content attribute of :after?
Here's the site in question:
http://www.TOS/
It's a TypePad site and I added custom styles for a redesign. The copyright line at the bottom is not part of the original HTML so I had to add it with CSS. Applying :after to the main container works good but I can't add anything other than plain text. No ©, no hyperlinks, and no url(copyright.html). It seems url only works for images, sounds and other media.
I have not found any discussion online on this topic. Does anyone have a solution?
Jeremy
<TOS>
[edited by: swa66 at 6:46 am (utc) on Sep. 11, 2009]