What is the compliant code, with regard to xhtml, for;
1)Internal page linking .
2.)Another page on the same server.
3) Open in a new window.
Upfront, thanks for any definitive answer.
What is the compliant code, with regard to xhtml, for;
1)Internal page linking .
2.)Another page on the same server.
3) Open in a new window.
Upfront, thanks for any definitive answer.
I'm not totally sure what you want answered with the first to, but there goes:
1) To link internally in the page:
2) To link to another page:Code:<a href="#anchor" title="Anchor Title">Link to anchor</a>
3) To open new windowCode:<a href="another_page.htm" title="Another Page">Another Page</a>
The third one is strange but is correct because XHTML has deprecated the target attribute and since the window target is deemed an interaction-level element it should either be specified by javascript or CSS (css3 I believe)Code:<a href="another_page.html" onclick="window.open(this.href); return false;" title="Another page new">Open in new window!</a>
This might be just a matter of personal taste, but are you not better off using single quotes? My main reasons using single rather than double quotes are:
1. It's faster to type (no shift key required)
2. It's doesn't require escaping in php (no backslash and shift key)
From a quick search, it seems that it should be double quotes (source), but xhtml strict validates with single quotes on the w3c validator.
I have always used double-quotes and I think we'd find that 95% of links to aswell.
1) I suppose but it is practically the same since you insert a double-quote with two different hands (I.E. It's still pratically one keystroke)
2) Well, if we want to get pedantic using single-quotes to escape PHP strings is faster for PHP to interpret and because double quotes are wider they are easier to see in the string.
That's my view anyway.
As for quoting attributes both single and double are valid, with similar quoting rules (Singles ok in double, double ok in single)
Thank you Sir,
Open in a new window though?
Can we do this xhtml? rather than js?
And thanks in either case.
yes, you can use
and if needed you can do the rezise on the new page with javascript.Code:<a href="page.php" target="_blank" title="you page">Link</a>
:. Web Design & Development Web Design Ireland
:. Search Engines Optimization Search Engines Optimization
:. Car Parts & Accessories Car Parts
:. Cars Ireland Cars Ireland
:. I Have 2 Find It Directory SEF Directory
beats me.
:. Web Design & Development Web Design Ireland
:. Search Engines Optimization Search Engines Optimization
:. Car Parts & Accessories Car Parts
:. Cars Ireland Cars Ireland
:. I Have 2 Find It Directory SEF Directory
As David said, target="_blank" is not xhtml (although it is xhtml transitional), here is another idea, and it is xhtml strict compliant. It also uses javascript though...
Weblog Tools Collection » Blog Archive » target=”_blank” XHTML 1.0 Strict Conversion
Last edited by SlitheryImp; 20-04-2007 at 07:13 PM.