I have written a simple template engine that replaces {{body}} {{nav}} (
there are others ) in a html file with generated content.
All generated output is encapsulated with xhtml complient <div> and
<span> tags with appropriately named class tags for css manipulation .
Doing so takes most of the design out of php and into the hands of the
user to use css to handle formatting.
This is all nice and simple for me as I only have to worry about
generating correct xhtml. A friend of mine may have hit a usability snag.
When a extenal link is generated in a post (
[url=http://etc]nicename[/url] or [url]http://etc[/url] ) i generate
links with class='extlink' for css specialization .
My friend realized that my :after {content:url(extpic);} css to generate
a wiki styled img at the end will not work in in ie .
Now I _think_ the way around this is to have a span to allow for ie
browsers to insert a background image <a href class='extlink'>name<span
class='extico'/></a>
( someone please suggest a site / newsgroup dealing with css . googling
for ie hacks is giving me a headache trying to pin them down )
I know ,I would I be better off, just adding the span for those wanting
to cater for IE. But I feel dirty writing a tag JUST to accommodate
style. But I realize 22 uncompressed bytes ,per link , is not going to
break any budgets and there is no point writing a conditional to check
for IE specific output.
Do any of you who do professional work consider this something they have
to just do to get things the way you want?
I have just wasted two days looking at css/JavaScript hacks ? do they
Even work? ( lack of a windows system to test atm and wine is not
playing happy with ie atm )
Meh .This whole post is mainly rhetorical.Any comments ,links , even
sarcasm will be welcome
regards trookat
The reason why you can't add the background image to the <a> tag itself
is... :-?
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
After much digging i discovered I could use background-position (
http://www.w3schools.com/css/pr_background-position.asp )
I fiddled around and came up with
.extlink
{
background-image: url('extlink.png');
background-repeat: no-repeat;
background-position: center right;
padding-right:20px;
}
Works in firefox , i'll get some friends to test it once ive upload the
latest alpha for testing
regards trookat
Conditional comments and behaviours are a better way of dealing with
this than writing browser specific PHP/Javascript but its still a
rather ugly hack. I'd lean towards using a re-writing engine to insert
the image inline in the HTML.
C.
You'll do better in comp.infosystems.www.authoring.stylesheets (I know
it isn't a very intuitive name!).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================
No small wonder that I could not find a related newsgroup. Thanks Kerry
regards trookat
And typos rule he day ! sorry Jerry . I'll just go submit myself to
shock therapy to make sure I check my posts before sending them.
No problem!