HTML/CSS/Frame Tags/frameset

Материал из Web эксперт
Перейти к: навигация, поиск

cols="150,*"

 
    
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<frameset cols="150,*">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
</frameset>
</html>



cols="200, *"

 
<?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>
<head>
  <title>Frames example</title>
</head>
<frameset cols="200, *">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" name="main_page" />
  <noframes><body>update your browser
   </body></noframes>
</frameset>
</html>



cols = "50%,50%"

 
<html>
<head>
<title>Changing Frames</title>
</head>
<frameset rows="20%,80%">
  <frame src="http://www.wbex.ru" name="frame1">
   <frameset cols = "50%,50%">
     <frame src="http://www.wbex.ru" name="frame2">
     <frame src="http://www.wbex.ru" name="frame3">
 </frameset>
</frameset>
</html>



frameborder="10"

 
<?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>
<head>
  <title>Frames example</title>
</head>
<frameset rows="150, *, 100" frameborder="10">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
  <noframes><body>update your browser.
   </body></noframes>
</frameset>
</html>



frame out of the frameset

 
<?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>
<head>
  <title>Frames example</title>
</head>
<frameset rows="*, 300, *">
  <frame src="http://www.wbex.ru" />
  <frameset cols="*, 400, *">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
  </frameset>
  <frame src="http://www.wbex.ru" />
  <noframes><body>update your browser
   </body></noframes>
</frameset>
</html>



"frameset" is used in conjunction with the "frame" element

<html>
<head>
<title>frameset element example</title></head>
<frameset rows="33%, 33%, *" cols="33%, 33%, *">
    <frame name="frame_1" src="http://www.wbex.ru">
    <frame name="frame_2" src="http://www.wbex.ru">
    <frame name="frame_3" src="http://www.wbex.ru">
    <frame name="frame_4" src="http://www.wbex.ru">
    <frame name="frame_5" src="http://www.wbex.ru">
    <frame name="frame_6" src="http://www.wbex.ru">
    <frame name="frame_7" src="http://www.wbex.ru">
    <frame name="frame_8" src="http://www.wbex.ru">
    <frame name="frame_9" src="http://www.wbex.ru">
</frameset>
<noframes>Your system doesn"t support frames.</noframes>
</html>



Frames example

 
<?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>
<head>
  <title>Frames example</title>
</head>
<frameset rows="150, *, 100">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
    <noframes><body>Unfortunately, your browser does
      not support this technology. </body></noframes>
</frameset>
</html>



framespacing="5"

 
<?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>
<head>
  <title>Frames example</title>
</head>
<frameset rows="150, *, 100" framespacing="5">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
  <noframes><body>update your browser
   </body></noframes>
</frameset>
</html>



name="main_frame"

 
<?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>
<head>
  <title>Fruit example</title>
</head>
<frameset cols="200, 450, *">
  <frame src="http://www.wbex.ru" />
  <frame name="main_frame" src="http://www.wbex.ru" />
  <noframes><body>update your browser
   </body></noframes>
</frameset>
</html>



noframes just in case

 
<!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">
<head>
<title>Lorem Ipsum</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset cols="250,*" frameborder="NO" border="0" framespacing="0">
<frame src="http://www.wbex.ru" name="NavigationFrame" title="Frame containing the navigation shortcuts for the Lorem Ipsum text in the LoremIpsum frame" scrolling="NO" noresize>
<frame src="http://www.wbex.ru" name="LoremIpsum" title="Frame containing the Lorem Ipsum text">
</frameset>
<noframes><body>
http://www.wbex.ru
</body></noframes>
</html>



rows="120,*"

 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<frameset rows="120,*">
    <frame src="http://www.wbex.ru" />
    <frameset cols="150,*">
        <frame src="http://www.wbex.ru" />
        <frame src="http://www.wbex.ru" />
    </frameset>
</frameset>
</html>



rows="150, *, 100"

 
<?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>
<head>
  <title>Frames example</title>
</head>
<frameset rows="150, *, 100" frameborder="0">
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
    <frame src="http://www.wbex.ru" />
  <noframes><body>update your browser.
   </body></noframes>
</frameset>
</html>



Set frame size in frameset

 

<!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">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<frameset cols="150,*">
    <frame src="http://www.wbex.ru" name="navigation" />
    <frame src="http://wbex.ru" name="content" />
</frameset>
</html>



target="_self" is the default value

 

<!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">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<p><a href="http://www.wbex.ru">This link opens in the same frame</a></p>
<p><a href="http://www.wbex.ru" target="_self">So does this one!</a></p>
</body>
</html>



This link opens a page to replace the frameset

 
<!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">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<p><a href="http://www.wbex.ru" target="_top">This link opens a page to replace the frameset</a></p>
</body>
</html>



This link opens in a frame with the name "content"

 
<!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">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<p><a href="http://www.wbex.ru" target="content">This link opens in a frame with the name "content"</a></p>
</body>
</html>