Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: xhtml frames

  1. #1
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Uk
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy xhtml frames

    I'm having trouble setting up a frameset and keeping it to the xhtml frameset format..


    http://www.abdn.ac.uk/~u14nw2/

    Basically I've had to put framespacing into the frameset part of the html but this isn't allowed... and if i remove it i'm left with a white space. Any ideas on how to fix this would be great

    <frameset cols="85,*,245" framespacing="0">
    <frame src="nav.htm" name="leftFrame" scrolling="no" frameborder="0" noresize="noresize"/>
    <frame src="news.htm" name="mainFrame" frameborder="0" />
    <frame src="link.htm" name="rightFrame" scrolling="no" frameborder="0" noresize="noresize"/>
    </frameset>

  • #2
    Moderator
    Join Date
    May 2002
    Location
    Hayward, CA
    Posts
    1,460
    Thanks
    1
    Thanked 23 Times in 21 Posts
    Hm. Here's a couple of ideas:

    (1) Examine the rules for spacing in CSS. Maybe you can add a CSS property to help out, bound to the frame element.

    (2) Maybe (although this is highly unlikely) you're getting whitespace from between the elements. Try removing it, see what happens.

    Sorry I can't be of more help here.
    "The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
    June 30, 2001
    author, Verbosio prototype XML Editor
    author, JavaScript Developer's Dictionary
    https://alexvincent.us/blog

  • #3
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Uk
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Alex. I think I'm just going to have to change the whole design of the site.. or downgrade (is that the right word) to html 4.1

    The site if for me to practice on so its meant to evolve

  • #4
    Regular Coder
    Join Date
    Sep 2002
    Location
    Burlington, VT
    Posts
    125
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey c'mon nick don't give up yet

    I am not sure exactly what you're talking about, is the white space on the left frame or the right frame?

    the css for padding would be style="padding:0" you can try adding that in to some stuff and seeing if it will validate. I personally don't use frames too often so I'm not sure what you're talking about... but your site looks pretty good to me.

    I just got done a project taking a 5 page website coded entirely in frontpage and rewriting it in xhtml 1.0 and valid css... if I can do that, you can do this!

    good luck.

    -Doug
    "The focused mind can pierce through stone."
    - Japanese Maxim

  • #5
    New to the CF scene
    Join Date
    Oct 2002
    Location
    Uk
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hehe ok dauvm you've inspired me. I'll keep working on it and I'm going to look into the css thing sometime this week when i get the chance.
    Last edited by Nick; 10-28-2002 at 11:20 AM.

  • #6
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    sorry for digging up an old post

    Quote Originally Posted by Nick
    hehe ok dauvm you've inspired me. I'll keep working on it and I'm going to look into the css thing sometime this week when i get the chance.
    Have you got a solution to your problem Nick?

    I checked your site, and it looks like you don't use frames anymore :P

    I have the same problem ...

    http://stw.ryerson.ca/~m4yip/transit/index.html
    This uses <frameset rows="25,450,25" frameborder="0">, which is a no-no to xhtml1.0 because only rows & cols can be used with frameset. However, it is the look that I want, i.e. no white frame strips.

    http://stw.ryerson.ca/~m4yip/transit/index2.html
    I've taken out frameborder="0", and it validates, but the white strips usually shown on frames appear now ...

    What can I do?

    I'm thinking it's something with the css, but I don't know what to do to the frameset in the css. Setting border-style and padding to none/0 doesn't work ...

    Any suggestions?

  • #7
    Regular Coder
    Join Date
    Jun 2005
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You're setting "frameborder" on the wrong element. It should be on the frame element. Here's an except from the XHTML1-Frameset DTD:

    Code:
    <!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"
      >
    - taken from http://www.w3.org/TR/xhtml1/dtds.htm...L-1.0-Frameset

  • #8
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sesshyzkidz
    You're setting "frameborder" on the wrong element. It should be on the frame element.
    - taken from http://www.w3.org/TR/xhtml1/dtds.htm...L-1.0-Frameset
    In index2.html, I do set frameborder="0" inside the frame element, i.e.
    Code:
    <frameset rows="25,450,25">
    
      <frame noresize="noresize" src="top.html" frameborder="0" />
      <frame noresize="noresize" src="middle.html" name="middleframe" frameborder="0" />
      <frame noresize="noresize" src="bottom.html" name="bottomframe" frameborder="0" />
    
    </frameset>
    The result is that the frame strips show, and I don't want that.

    Is there anything else I can do, or is that how frames have to be?

  • #9
    Regular Coder
    Join Date
    Jun 2005
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could set the marginheight and marginwidth attributes. They are equivalent to the dead framespacing attribute.

    Previous usage:
    <frame src="src.html" framespacing="0">

    New usage:
    <frame src="src.html" marginheight="0" marginwidth="0"/>

  • #10
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah ... I see

    Thanks sesshyzkidz!

    I will try that when I get home tonight.

    [edit]

    hm ... so, it becomes
    Code:
    <frameset rows="25,450,25">
    
      <frame noresize="noresize" src="top.html"  marginheight="0" marginwidth="0" />
      <frame noresize="noresize" src="middle.html" name="middleframe"  marginheight="0" marginwidth="0" />
      <frame noresize="noresize" src="bottom.html" name="bottomframe"  marginheight="0" marginwidth="0" />
    
    </frameset>
    Still doesn't get rid of my problem.

    See http://stw.ryerson.ca/~m4yip/transit/index3.html vs. http://stw.ryerson.ca/~m4yip/transit/index.html

    I appreciate the help though ...

    Does anyone know how to properly get rid of those frame strips?
    Last edited by aznrocket; 06-18-2005 at 03:32 AM.

  • #11
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi sorry to dig up again but i am also searching for the solution to this problem

    I have 2 white strips between middle frame and the top and bottom frames,

    have you managed to solve this as i noticed that there are no white gaps in your second link aznrocket

  • #12
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Also searching for the answer...

    When I put frameborder="0" back in the frameset element (which we're not supposed to do) it fixes the white stripe in Firefox, but not in IE6. Anybody else get a solution to this? It seems that the white stripe has to be there if we want to use frames - surely a whopping flaw in xhtml?

  • #13
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just inserted border="0" into the frameset tag and it fixed it, however it won't validate.

    I accepted defeat on the issue, the frames look fine though, pity it couldn't have been achieved with validation.

  • #14
    New to the CF scene
    Join Date
    Feb 2008
    Location
    New York
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Solution to the XHTML and Firefox frames issue

    Well I decided to think in a differnt approach since I want all of my pages to be valid XHTML 1.0 transitional pages, but I don't want to give up frames.

    I will show you the changes I made.

    ORIGINAL CODE:

    <?xml version="1.0" encoding="iso-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Phillydog's Webpage</title>
    <meta name="DESCRIPTION" content="A place where you can get the newest HTML tricks, or trade non-sport cards!" />
    <meta name="KEYWORDS" content="Philip, Brazina, phillydog" />
    </head>
    <frameset id="fmain" cols="175,*">
    <frame name="Menu" src="bar.html" scrolling="auto" frameborder="0" noresize="noresize" marginwidth="10" marginheight="10" />
    <frame name="Content" src="main.html" scrolling="auto" frameborder="0" marginwidth="3" />
    </frameset>
    </html>


    MODIFIED CODE:

    <?xml version="1.0" encoding="iso-8859-1" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Phillydog's Webpage</title>
    <meta name="DESCRIPTION" content="A place where you can get the newest HTML tricks, or trade non-sport cards!" />
    <meta name="KEYWORDS" content="Philip, Brazina, phillydog" />
    <script type="text/javascript">
    <!--
    var nVer = navigator.appVersion;
    var nAgt = navigator.userAgent;
    // In Internet Explorer, the true version is after "MSIE" in userAgent
    if ((verOffset=nAgt.indexOf("MSIE"))!=-1) {
    browser_spec='framespacing="0"';
    }
    // In Firefox, the true version is after "Firefox"
    else if ((verOffset=nAgt.indexOf("Firefox"))!=-1) {
    browser_spec='border="0"';
    }
    // In Opera, the true version is after "Opera"
    else if ((verOffset=nAgt.indexOf("Opera"))!=-1) {
    browser_spec='border="0"';
    }
    // In Netscape, the true version is after "Netscape"
    else if ((verOffset=nAgt.indexOf("Netscape"))!=-1) {
    browser_spec='border="0" framespacing="0"';
    }
    // In Safari, the true version is after "Safari"
    else if ((verOffset=nAgt.indexOf("Safari"))!=-1) {
    browser_spec='border="0" framespacing="0"';
    }

    // In other browsers
    else if ( (nameOffset=nAgt.lastIndexOf(' ')+1) < (verOffset=nAgt.lastIndexOf('/')) )
    {
    browser_spec='';
    }
    document.write('<frameset id="fmain" ' +browser_spec+ ' cols=\"175,*\">'+
    '<frame name="Menu" src="bar.html" scrolling="auto" frameborder="0" noresize="noresize" marginwidth="10" marginheight="10" />'+
    '<frame name="Content" src="main.html" scrolling="auto" frameborder="0" marginwidth="3" />'+
    '</frameset>');
    // -->
    </script>
    </head>
    <body>
    </body>
    </html>


    Basically I am using the DTD for XHTML pages rather than the DTD for FRAMESETs and then I am using javascript to populate the entire frameset + frames.

    Using conditions, I can add the 'framespacing="0"' for IE, 'border="0"' for firefox, a condition for Opera, and then 'other'. The 'other' is what the XHTML validation from w3c uses.

    This works for IE 5.5/6.0/7.0, Firefox 1.5/2.0, Opera 9.2x, , Safari 1.x/2.x/3.x, Gecko (according to browsershots.org).

    I hope this helps, and if so, perhaps one of you guys can help me when I have an issue in the future.... I still have my 'font-face' issues using custom fonts with FF.

    If it works, drop me a line and let me know.
    Last edited by pbrazina; 02-17-2008 at 01:47 PM.

  • #15
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    That's not valid XHTML. At all. Your Javascript content is not escaped correctly and you can not use document.write in an XML document.

    Using Javascript to get around having to create valid documents is not the way to go. Use HTML. All of you. Including you OP. If you're using XHTML I guarantee you're using it wrong.
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •