Jump to content

Frameset border


darknightelor

Recommended Posts

Hello all,When I try to validate HTML page with the XHTML validator, it says no attribute as "border" exists. Which is very weird, surely that attribute exists, it defines the size of the border of the frame. So, why the heck won't it let me validate the page?!

<!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> Body </title> </head><frameset rows="8%,82%,8%" border="0" >	<frame src="upper_frame.html" name="upper" scrolling="no" noresize>		<frame src="middle1_frame.html" name="middle1" scrolling="auto" noresize>   	<frame src="lower_frame.html" name="lower" scrolling="no" noresize></frameset><body> </body></html>

And one other small thing: Is it recommanded to work with frames? I've read a long article saying Table is BAD, and then I read here a comment that Frame is not good. Can someone with alot of expereince advise me?Thank you.

Link to comment
Share on other sites

There's no attribute border, check here:http://w3schools.com/tags/tag_frameset.aspThe frame tag ( http://w3schools.com/tags/tag_frame.asp ) has a frameborder attribute you can use.Frames aren't the recommended way to build a site though, if you can learn CSS and PHP you shouldn't have trouble with making websites without frames.The biggest disadvantage of frames is that they break the "back" button of the browser, and people aren't able to save the URLs of your pages.

Link to comment
Share on other sites

This is weird, though. When I use the attribute "border", it works fine and changes the border accordingly (8 will show wider border than 1).And how can I arrange my page with CSS the way I do it with frames? I mean, with the frameset I can edit each frame on its own without one long html code to define it all (or CSS code).

Link to comment
Share on other sites

You use PHP to load the separate content. What's more, you don't have to write a full HTML document for each piece, you just write the relevant code. Here's an example:index.php:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>  <head>	<title>My website</title>		<style type="text/css">		  #menu { width: 180px; float: left; }		  #content { margin-left: 180px; }		</style>  </head>  <body>	<div id="menu"><?php include("menu.php");</div>	<div id="content"><?phpswitch($_GET['s']) {case "about":$section = "about.php";break;case "contact":$section = "contact.php";break;default:$section = "main.php";}include($section);	?></div>  </body></html>

menu.php:

<ul>  <li><a href=".">Home</a></li>  <li><a href="?s=about">About us</a></li>  <li><a href="?s=contact">Contact us</a></li></ul>

main.php

<h1>My site</h1><p>Welcome to my website</p>

about.php:

<h1>About me</h1><p>This section is about me</p>

contact.php:

<?phpif(strlen($_POST['subject']) && strlen($_POST['message'])) {// Email sending script here} else {?><form action="" method="post">Subject: <input type="text" name="subject"><br>Message:<br><textarea name="message" rows="5" cols="20"></textarea><br><input type="submit" value="Send mail"></form><?php } ?>

Link to comment
Share on other sites

This is weird, though. When I use the attribute "border", it works fine and changes the border accordingly (8 will show wider border than 1).
Depending on the browser, this is just backward compatibility and/or quirksmode (transitional) rendering. If that didn't exist, a bazillion pages written according to old specs would now be non-functional. You don't want to force your browser into quirksmode, though, since that will keep you from accessing the current implementation of certain features.
Link to comment
Share on other sites

He's just showing PHP as an example of including one file in another file, but PHP doesn't have anything to do with creating valid HTML code. In this case he's just using PHP so that the common code that all pages use only needs to be in one file.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...