7 replies [Last post]
Pman
Pman's picture
Offline
Enthusiast
Sweden
Last seen: 14 years 39 weeks ago
Sweden
Timezone: GMT+2
Joined: 2004-04-15
Posts: 60
Points: 0

Ok, I'm not done yet Wink...The layouts pretty much a basic one, just yet, needs ome pic's an so on...

http://pman.urlq.com/test/css_test.htm

I was wondering, however (the links doesn't go anywhere yet, except the external ones), was how to fix eg links to images to open up in a new window...I can't "target" them due to the XHTML strict thing...It won't validate then...

Is there a way via CSS to make certain links (controlled by class) to open up in a new window ?

Can't figure this out, can anyone help me ?

Patric.

Anything that happens to irritate you, will happen atleast once more
- p-ahlqvist.com - Online, not entirely done contentwise, but I'm up

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 32 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Would somebody have a looksie ?

'fraid not! Sad

You're going to have to use a pop-up Javascript on XHTML Strict and beyond, if you require validation.

The next sentence is true. The previous sentence is false. Discuss...

Pman
Pman's picture
Offline
Enthusiast
Sweden
Last seen: 14 years 39 weeks ago
Sweden
Timezone: GMT+2
Joined: 2004-04-15
Posts: 60
Points: 0

Would somebody have a looksie ?

A tip, perhaps...

If I have a javascript it won't validate, will it ?

Is it that important to have it validated really, sure it looks nice, but still ?

Anything that happens to irritate you, will happen atleast once more
- p-ahlqvist.com - Online, not entirely done contentwise, but I'm up

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 32 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Would somebody have a looksie ?

Inclusion of the Javascript is fine for validation, as long as the Javascript is coded correctly.

If you're asking me, I think validation is important. Simply because, if you let a few rules slip, then I would fear that you've set yourself on a downwards slope. Sorta, 'ah, what the heck, I'll give up on that little rule as well!'

Remember, you're coding for the future as well as the past (whoa! Shock Laughing out loud )

The next sentence is true. The previous sentence is false. Discuss...

Stu
Stu's picture
Offline
Enthusiast
Bristol uk
Last seen: 18 years 45 weeks ago
Bristol uk
Joined: 2004-01-20
Posts: 282
Points: 0

Would somebody have a looksie ?

xhtml1.1 allows you to add elements etc so you could put target back into links such that the validator should allow this.

Change your doctype to

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd"
[ <!ATTLIST a target CDATA #IMPLIED > ]>

HOWEVER browsers cannot handle this construction and will print the last ]> on the screen. This can be overcome by specifying
body {position:absolute; top:-18px; /* or some value to move the ]> off screen */

It's not what you do it's the way that you do it.
So do it with STYLE
http://www.s7u.co.uk

rmfred
rmfred's picture
Offline
Elder
Rock Springs, WY
Last seen: 4 years 7 weeks ago
Rock Springs, WY
Timezone: GMT-6
Joined: 2004-01-31
Posts: 1073
Points: 31

Would somebody have a looksie ?

You can use this... will validate as xhtml strict
//* This is for external links
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

html:

<a href="yourpage.html" rel="external">Link</a>

Pman
Pman's picture
Offline
Enthusiast
Sweden
Last seen: 14 years 39 weeks ago
Sweden
Timezone: GMT+2
Joined: 2004-04-15
Posts: 60
Points: 0

Would somebody have a looksie ?

Sorry for being such a dumbass...

Where do I put that script ? if I put it in a scripttag in the head, it won't validate as strict XHTML...And if I just put it in like it is...well, hehe...that don't work...

P

Anything that happens to irritate you, will happen atleast once more
- p-ahlqvist.com - Online, not entirely done contentwise, but I'm up

Pman
Pman's picture
Offline
Enthusiast
Sweden
Last seen: 14 years 39 weeks ago
Sweden
Timezone: GMT+2
Joined: 2004-04-15
Posts: 60
Points: 0

Ok...I think I'm done...

...code wise...The visual layout could use some improvment...I've gone from XHTML strict to transitional...I really don't know which one is better or why, but this one was more "workable" to me.

here it is

Remember that I'm a beginner at this, and do it on sparetime, so...be gentle, hehe...

(I would like to add a shadow to the outer div, so that it would seem to be somewhat 3d'ish, know what I mean ? Hints ?)

Patric.

Anything that happens to irritate you, will happen atleast once more
- p-ahlqvist.com - Online, not entirely done contentwise, but I'm up