एक से ज्यादा HTML Documents को एक ही webpage पर display करने के लिए frames का इस्तेमाल किया जाता है | Frames ये HTML5 से अब हटा दिया गया है, इसे इस्तेमाल ना करना ही बेहतर रहेगा |
Frames का इस्तेमाल क्यों नहीं किया जाता ?
दुनिया में अब बहुत सारी Web Development languages का निर्माण होने के कारण Frames का इस्तेमाल कोई भी नहीं करता है जैसे कि, PHP, ASP, CSS.
Frames को HTML5 से हटा दिया गया है |
Syntax for Frames in HTML
<head> <frameset> <frame> </frameset> </head>
HTML Frames
Frames का इस्तेमाल एक ही window पर एक से ज्यादा HTML Document को display करने के लिए इस्तेमाल किया जाता है |
left.htmlcenter.html<html> <body> <h1>Left</h1> </body> </html>
right.html<html> <body> <h1>Center</h1> </body> </html>
sample.html<html> <body> <h1>Right</h1> </body> </html>
<frameset cols = "500,600,700" border="5">
<frame name = "left" src = "left.html" />
<frame name = "center" src = "center.html" />
<frame name = "right" src = "right.html" />
</frameset>
Output :
Frames will be used with the given HTML document below
<html> <body> <h1>Top</h1> </body> </html>
<html> <body> <h1>Bottom</h1> </body> </html>
<html> <body> <h1>Left</h1> </body> </html>
<html> <body> <h1>Center</h1> </body> </html>
<html> <body> <h1>Right</h1> </body> </html>
rows Attribute(Horizontal Frameset) for <frameset> tag in HTML
rows attribute में frames के क्रमानुसार rows की size को दिया जाता है |
Example पर तीन frames की size को दिया है | पहले frame की size; pixel में दी गयी है, पहले frame की size; percentages में दी गयी है और पहले frame की size; browser द्वारा automatically गयी है |
px(without px) | इसके साथ या इसके बिना दी हुई size ये screen के pixel के हिसाब से होती है | For Example, 200, 100, 50 |
% | इसके साथ दी हुई size ये screen के resolution के percentages के हिसाब से होती है | For Example, अगर screen; 1300 pixel हो और 20% दिया हो तो frame को 260px तक set किया जाएगा | |
* | इस symbol को देने पर browser द्वारा size को automatically दिया जाता है | |
<frameset rows = "200,30%,*">
<frame name = "left" src = "left.html" />
<frame name = "center" src = "center.html" />
<frame name = "right" src = "right.html" />
</frameset>
Output :
cols Attribute(Vertical Frameset) for <frameset> tag in HTML
cols attribute में frames के क्रमानुसार cols की size को दिया जाता है |
Example पर तीन frames की size को दिया है | पहले frame की size; pixel में दी गयी है, पहले frame की size; percentages में दी गयी है और पहले frame की size; browser द्वारा automatically गयी है |
px(without px) | इसके साथ या इसके बिना दी हुई size ये screen के pixel के हिसाब से होती है | For Example, 200, 100, 50 |
% | इसके साथ दी हुई size ये screen के resolution के percentages के हिसाब से होती है | For Example, अगर screen; 1300 pixel हो और 20% दिया हो तो frame को 260px तक set किया जाएगा | |
* | इस symbol को देने पर browser द्वारा size को automatically दिया जाता है | |
<frameset cols = "200,30%,*">
<frame name = "left" src = "left.html" />
<frame name = "center" src = "center.html" />
<frame name = "right" src = "right.html" />
</frameset>
Output :
Examples for <frameset> and <frame> tags in HTML

Output :<frameset rows = "15%,*,15%"> <frame name = "top" src = "top.html" /> <frameset cols = "15%,*"> <frame name = "left" src = "left.html" /> <frame name = "right" src = "right.html" /> </frameset> <frame name = "bottom" src = "bottom.html" /> </frameset>

Output :<frameset rows="50%,50%" cols="50%,50%"> <frame name = "left" src = "left.html" /> <frame name = "right" src = "right.html" /> <frame name = "left" src = "left.html" /> <frame name = "right" src = "right.html" /> </frameset>
frameborder attribute for <frameset> and <frame> tag
<frameset> और <frame> के frameborder इस attribute से frameborder को set किया जाता है | frameborder की value '0' या '1' हो सकती है |
Output :<frameset rows="30%, 70%"> <frame src = "top.html" frameborder="0"/> <frameset cols = "30%, *"> <frame src = "left.html" frameborder="0"/> <frame src = "right.html" frameborder="0"/> </frameset> </frameset> <!-- OR --> <frameset rows="30%, 70%" frameborder="0"> <frame src = "top.html"/> <frameset cols = "30%, *" frameborder="0"> <frame src = "left.html"/> <frame src = "right.html"/> </frameset> </frameset>
marginheight attribute for <frame> tag
marginheight attribute से frame के content को frame के top से height दी जाती है |
Output :<frameset cols="*, *, *"> <frame src = "left.html" marginheight="0"/> <frame src = "center.html" marginheight="100"/> <frame src = "right.html" marginheight="200"/> </frameset>
marginwidth attribute for <frame> tag
marginwidth attribute से frame के content को frame के left से width दी जाती है |
Output :<frameset cols="*, *, *"> <frame src = "left.html" marginwidth="0"/> <frame src = "center.html" marginwidth="100"/> <frame src = "right.html" marginwidth="200"/> </frameset>
noresize attribute for <frame> tag
Normal frame को resize किया जा सकता है, लेकिन noresize attribute के साथ दिए जानेवाले frame को resize नहीं किया जा सकता है |
<frameset cols="*, *, *">
<frame src = "left.html" noresize="noresize"/>
<frame src = "center.html"/>
<frame src = "right.html"/>
</frameset>
Output :
scrolling attribute for <frame> tag
Normal frame का scrolling; attribute की by default value 'yes' होती है, लेकिन scrolling attribute पर 'no' value दी जाती है तो frame के scroll को disabled किया जाता है |
Output :<frameset cols="*, *, *"> <frame src = "left.html" scrolling="no"/> <frame src = "center.html" scrolling="yes"/> <frame src = "right.html"/> </frameset>
'<frame>' tag के 'name' इस attribute को जानने के लिए यहाँ click करे |