Forum Moderators: open

Message Too Old, No Replies

Valid XHTML Frames?

         

JAB Creations

8:00 pm on Nov 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm trying to get my frameset to validate. The w3 validator isn't playing nice and I'm seeing no xhtml examples on the net and the other half is composed of cranky anti-frame people.


<frameset rows="5,1*,32" frameborder="0" framespacing="0">
<frame src="http://www.example.com/home/home-border-top.php" name="border" noresize="noresize" scrolling="no" />
<frame src="home-news.html" name="content" noresize="noresize" scrolling="no" />

<frameset cols="1*,431" frameborder="0" framespacing="0">
<frame src="http://www.example.com/home/home-border-bottom-1.php" name="copyright" noresize="noresize" scrolling="no" />
<frame src="http://www.example.com/mplayer/jab-creations-home-choose.htm" name="mplayer" noresize="noresize" scrolling="no" />
</frameset>
</frameset>

[edited by: Woz at 9:26 am (utc) on Nov. 16, 2004]
[edit reason] examplified [/edit]

tedster

8:08 pm on Nov 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using the frameset DTD?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

JAB Creations

8:18 pm on Nov 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



yip yip

Saltminer

10:02 pm on Nov 14, 2004 (gmt 0)

10+ Year Member



You have to do it a little differently. The frameborder and framespacing have to go in the <frame> tag to validate.

<frameset rows="5,1*,32">
<frame frameborder="0" marginwidth="0" marginheight="0" src="http://www.example.com/home/home-border-top.php" name="border" noresize="noresize" scrolling="no" />


You have to take care of the spacing with marginwidth and marginheight.

I don't do any framed pages, but that should work, or at least be close.

[edited by: Woz at 9:28 am (utc) on Nov. 16, 2004]
[edit reason] examplified [/edit]

createErrorMsg

3:55 am on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



the other half is composed of cranky anti-frame people.

I'm guessing it's more than half. Framesets are out these days primarily because they are so SERP un-friendly.

To quote Google's Information For Webmasters [google.com]...

Reasons your site may not be included.
...
Your page uses frames. Google supports frames to the extent that it can. Frames tend to cause problems with search engines, bookmarks, emailing links and so on, because frames don't fit the conceptual model of the web (every page corresponds to a single URL). If a user's query matches the site as a whole, Google returns the frame set. If a user's query matches an individual page on the site, Google returns that page. That individual page is not displayed in a frame -- because there may be no frame set corresponding to that page.

My bold.

JAB Creations

11:52 am on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm falling back to 4.01 transitional for a couple of reasons...

1.) No one has nor (seems to have the) will to display full fledged examples of XHTML frames.

2.) Frames are only necessary until I become extremely proficient in flash

The reason I use frames is to allow music to play on my site while browsing and not opening up another window. Until I learn how to make a dynamic player that can make reference to CSS and use an admin playlist with javascript to interact with the player I'm going to have to use frames.

The only thing now that is not validating is the border="0" attribute which CSS has failed to cover unfortunitly. I tested css to remove the border with no luck.

Saltminer

12:34 pm on Nov 15, 2004 (gmt 0)

10+ Year Member



I didn't see any "border=0" in the script you provided. Where are you having trouble with that?

Try this site for XHTML frame info:
[webdevfoundations.net...]

And another:
[academ.hvcc.edu...]

Searching will find some more, but as you've noticed frames are just not very popular anymore.

JAB Creations

4:32 pm on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's in the XHTML DTD...BUT W3 doesn't even validate that! For goodness sakes! W3 doesn't even validate code it approves of? >__>

JAB Creations

4:36 pm on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Neither site helped unfortunitly. I have my frames working and validating except for the border="0" which IS valid according to XHTML DTD.


<frameset rows="5,1*,32" border="0">
<frame src="http://www.example.com/home/home-border-top.php" name="border" scrolling="no">
<frame src="home-news.html" name="content" noresize="noresize" scrolling="no">

<frameset cols="1*,431" border="0">
<frame src="http://www.example.com/home/home-border-bottom-1.php" name="copyright" noresize="noresize" scrolling="no">
<frame src="http://www.example.com/mplayer/jab-creations-home-choose.htm" name="mplayer" noresize="noresize" scrolling="no">
</frameset>
</frameset>

[edited by: Woz at 9:35 am (utc) on Nov. 16, 2004]
[edit reason] examplified [/edit]

createErrorMsg

5:47 pm on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



except for the border="0" which IS valid according to XHTML DTD

Framesets need frameborder, which is not a CSS property. I don't believe it will accept border as a substitute. You could put frameborder as an inline HTML attribute, but it may not validate as XHTML.

Span

9:35 pm on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Border is not in the frameset dtd. Not for <frame> or <frameset>:


<!ELEMENT frameset (frameset¦frame¦noframes)*>
<!ATTLIST frameset
%coreattrs;
rows %MultiLengths; #IMPLIED
cols %MultiLengths; #IMPLIED
onload %Script; #IMPLIED
onunload %Script; #IMPLIED
>

<!ELEMENT frame EMPTY>
<!ATTLIST frame
%coreattrs;
longdesc %URI; #IMPLIED
name NMTOKEN #IMPLIED
src %URI; #IMPLIED
frameborder (1¦0) "1"
marginwidth %Pixels; #IMPLIED
marginheight %Pixels; #IMPLIED
noresize (noresize) #IMPLIED
scrolling (yes¦no¦auto) "auto"
>

Saltminer

10:21 pm on Nov 15, 2004 (gmt 0)

10+ Year Member



Look in mesg #4 that I posted above.

There I put the frameborder="0" into the <frame> tag, that will validate. As I said, you can't put it into <frameset>.

JAB Creations

6:30 am on Nov 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes I said border="0" is valid with xhtml but does not validate on the w3 validator...

frameborder="0" in the frame tag works and the page validates...pause... now there is framespacing and framespacing does not validate... How can I remove the framespacing and have it validate now?

JAB Creations

6:40 am on Nov 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You know what? Forget it! This issue brought to you by the same people who released strict DTDs without a substitute for target!

<frame id=bob

class=bob

id: bob;

And I fail to understand why other people fail to realize why standards aren't so popular...

JAB Creations

3:21 pm on Nov 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is the best I have fiddled with, 1 invalidation on the validator...


<frameset rows="5,1*,32" border="0">
<frame src="http://www.example.com/home/home-border-top.php" frameborder="0" name="border" scrolling="no">
<frame src="home-news.html" frameborder="0" name="content" noresize="noresize" scrolling="no">

<frameset cols="1*,431" border="0">
<frame src="http://www.example.com/home/home-border-bottom-1.php" frameborder="0" name="copyright" noresize="noresize" scrolling="no">
<frame src="http://www.example.com/mplayer/example-home-choose.htm" frameborder="0" name="mplayer" noresize="noresize" scrolling="no">
</frameset>
</frameset>

[edited by: BlobFisk at 3:51 pm (utc) on Nov. 16, 2004]
[edit reason] No Specifics Allowed - use example.com please. [/edit]

encyclo

3:35 pm on Nov 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Frameset DTDs are pretty broken in terms of real-world use. It is easy enough to make a frameset which validates but has borders everywhere, but the generally-preferred borderless frames aren't possible in a valid way, as far as I know.

You've got it down to one inconsequential error for an unrecognized attribute, which I would consider to be quite sufficient.

Frames are riddled with usability and accessibility caveats anyway, so there are very few supporters of standards who would use them - hence the impoverished spec. I rarely use frames unless absolutely vital, and whereas I like to have valid pages everywhere, I don't bother with attempting to validate the framesets or even adding a doctype.

Saltminer

10:44 pm on Nov 16, 2004 (gmt 0)

10+ Year Member




frameborder="0" in the frame tag works and the page validates...pause... now there is framespacing and framespacing does not validate... How can I remove the framespacing and have it validate now?

Read my msg #4 again. You have to use marginheight and marginwidth in <frame>. I gave you an example that would provide a frame border and spacing, and it will validate.