Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-09-04 13:21:49
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
CSS tag attribute
The css tag dosen’t allow for html tag ends, only xhtml tag ends. It always outputs /> when just > might be required.
Last edited by lee (2006-09-04 13:22:29)
Offline
Re: CSS tag attribute
That should be compatible with HTML: <a href=“http://www.w3.org/TR/xhtml1/#guidelines”>http://www.w3.org/TR/xhtml1/#guidelines</a> (C2 emtpy elements).
By default <code><txp:css /></code> outputs an URL instead of a link tag, so the browser won’t even see the “ />” part of the <code><txp:css /></code> tag.
Offline
#3 2006-09-04 14:15:56
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: CSS tag attribute
<code><txp:css format=“link” /></code> gives me <code><link rel=“stylesheet” type=“text/css” media=“screen” href=“http://www.mysite.com/textpattern/css.php?s=default” /></code> – it’s the /> I’m on about.
Last edited by lee (2006-09-04 14:16:15)
Offline
Re: CSS tag attribute
Leave out the <code>format =“link”</code> attribute (or change it to ‘url’ instead of ‘link’). See the <a href=“http://textbook.textpattern.net/wiki/index.php?title=Txp:css_/”>examples</a> in the manual.
This should do what you want:
<code><link rel=“stylesheet” type=“text/css” media=“screen” href=”<txp:css />”></code>
Last edited by ruud (2006-09-04 14:31:52)
Offline
Re: CSS tag attribute
lee wrote:
<code><txp:css format=“link” /></code> gives me <code><link rel=“stylesheet” type=“text/css” media=“screen” href=“http://www.mysite.com/textpattern/css.php?s=default” /></code> – it’s the /> I’m on about.
textpattern is by default producing xhtml code. If you desperately need to have it as html you may just hard code the link to the stylesheet without the />. Having said that, it is not advisable as it will make migration of the site harder.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: CSS tag attribute
If you’re needs aren’t that demanding (ie. You don’t use line breaks in Textile or TXP tag such as break=”“), all you need to do is edit /textpattern/publish/taghandlers.php. For me, it took about a minute or so to remove the “/>” from the image tags.
Offline
#7 2006-09-04 23:43:20
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: CSS tag attribute
Is there a reason for removing the “/”? It should be valid HTML, as ruud says.
Alex
Offline
Re: CSS tag attribute
zem wrote:
Is there a reason for removing the “/”? It should be valid HTML, as ruud says.
Valid XHTML. nitpicker :).
Just as some people want to use the mimetype application/xhtml+xml
for their site, some people want to serve it as valid HTML 401 strict (where the closing /> should be > for img tags, form controls, and some more, like the link
tag for stylesheets, or feeds).
Both should be handled by a plugin. For the first one, that plugin exists. Someone takes up the job for HTML 401 ?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
#9 2006-09-05 00:41:40
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: CSS tag attribute
Ah, I was under the impression />
was always valid HTML4.
Alex
Offline
Re: CSS tag attribute
Did some tests on validator.w3.org:
It doesn’t matter if the server sends it with content-type: text/html instead of application/xhtml+xml, as long as the doctype matches the rest of the (x)html code. For TXP, you should probably be using a XHTML doctype if you want it to pass validation.
The compatibility guidelines I linked to in my earlier response are only to make sure that your XHTML document can still be parsed by a HTML-only user agent.
Last edited by ruud (2006-09-05 01:03:11)
Offline
Re: CSS tag attribute
Offline
Pages: 1