Learn how to create a webpage with framesets using the <frameset> and <frame> tags to divide the browser window into multiple sections.
To create an HTML webpage that demonstrates the use of framesets using the <frameset> and <frame> tags to divide the browser window into multiple sections.
Framesets allow you to divide the browser window into multiple sections, each displaying a separate HTML document. Key elements:
<frameset> — Defines the layout of frames (rows or columns).<frame> — Defines a single frame within the frameset.<noframes> — Provides content for browsers that don't support frames.<frameset> and <frame> tags are deprecated in HTML5. They are still supported by most browsers but are not recommended for new projects. Use CSS Flexbox or CSS Grid instead. However, they are still useful for learning purposes.
target attribute.
Header + 2 Columns + Footer
2 Columns (Left + Right)
2 Rows (Top + Bottom)
| Attribute | Purpose | Example |
|---|---|---|
rows |
Defines the height of rows (percentage or pixels) | rows="20%, 70%, 10%" |
cols |
Defines the width of columns (percentage or pixels) | cols="25%, 75%" |
frameborder |
Specifies whether to show frame borders (0 or 1) | frameborder="1" |
border |
Sets the border thickness in pixels | border="2" |
src |
Specifies the HTML file to display in the frame | src="content.html" |
name |
Assigns a name to the frame (for targeting links) | name="main" |
scrolling |
Controls scrollbars (yes, no, auto) | scrolling="auto" |
| Layout | Code | Description |
|---|---|---|
| 2 Columns | <frameset cols="30%, 70%"> |
Left navigation, right content |
| 2 Rows | <frameset rows="50%, 50%"> |
Top and bottom sections |
| 3 Rows | <frameset rows="15%, 75%, 10%"> |
Header, content, footer |
| Header + Columns + Footer | <frameset rows="15%, 75%, 10%"> ... <frameset cols="25%, 75%"> |
Header, navigation + content, footer |
| Columns + Header | <frameset cols="30%, 70%"> ... <frameset rows="20%, 80%"> |
2-column layout with nested frames |
| Mistake | Why It's Wrong | Correct Way |
|---|---|---|
Using <body> with <frameset> |
Invalid HTML structure | Use either <body> or <frameset>, not both |
Forgetting <noframes> fallback |
Poor accessibility | Always include <noframes> content |
Missing name attribute on frames |
Targeting links won't work | Add name to frames you want to target |
| Using percentages that don't add to 100% | Layout issues | Ensure rows/cols add up to 100% |
Not closing the <frameset> tag |
Invalid HTML | Always close with </frameset> |
<frameset> divides the browser window into rows or columns.<frame> loads an HTML document in each section.name attribute allows targeting links to specific frames.<noframes> provides content for browsers that don't support frames.You have successfully:
<frameset> and <frame> tags.target attribute to load content into specific frames.<noframes> fallback content.ایک HTML ویب صفحہ بنانا جو فریم سیٹس کے استعمال کو <frameset> اور <frame> ٹیگز کے ساتھ براؤزر ونڈو کو متعدد حصوں میں تقسیم کرنے کا طریقہ ظاہر کرتا ہے۔
فریم سیٹس آپ کو براؤزر ونڈو کو متعدد حصوں میں تقسیم کرنے کی اجازت دیتے ہیں، ہر حصہ ایک الگ HTML دستاویز ظاہر کرتا ہے۔ اہم عناصر:
<frameset> — فریموں کی ترتیب کی وضاحت کرتا ہے (قطاریں یا کالم)۔<frame> — فریم سیٹ کے اندر ایک فریم کی وضاحت کرتا ہے۔<noframes> — ان براؤزرز کے لیے مواد فراہم کرتا ہے جو فریمز کو سپورٹ نہیں کرتے۔<frameset> اور <frame> ٹیگز HTML5 میں متروک ہیں۔ وہ زیادہ تر براؤزرز کے ذریعہ اب بھی سپورٹ کیے جاتے ہیں لیکن نئے پروجیکٹس کے لیے تجویز نہیں کیے جاتے۔ اس کی بجائے CSS Flexbox یا CSS Grid استعمال کریں۔ تاہم، وہ سیکھنے کے مقاصد کے لیے اب بھی مفید ہیں۔
target صفت کا استعمال کرتے ہوئے دائیں فریم میں مواد لوڈ کرتے ہیں۔
ہیڈر + 2 کالم + فوٹر
2 کالم (بائیں + دائیں)
2 قطاریں (اوپر + نیچے)
| صفت | مقصد | مثال |
|---|---|---|
rows |
قطاروں کی اونچائی کی وضاحت کرتا ہے (فیصد یا پکسلز) | rows="20%, 70%, 10%" |
cols |
کالموں کی چوڑائی کی وضاحت کرتا ہے (فیصد یا پکسلز) | cols="25%, 75%" |
frameborder |
فریم بارڈرز دکھانے ہیں یا نہیں (0 یا 1) | frameborder="1" |
border |
بارڈر کی موٹائی پکسلز میں سیٹ کرتا ہے | border="2" |
src |
فریم میں ظاہر کرنے کے لیے HTML فائل کی وضاحت کرتا ہے | src="content.html" |
name |
فریم کو ایک نام تفویض کرتا ہے (لنکس کو نشانہ بنانے کے لیے) | name="main" |
scrolling |
اسکرول بارز کو کنٹرول کرتا ہے (yes، no، auto) | scrolling="auto" |
| لے آؤٹ | کوڈ | وضاحت |
|---|---|---|
| 2 کالم | <frameset cols="30%, 70%"> |
بائیں نیویگیشن، دائیں مواد |
| 2 قطاریں | <frameset rows="50%, 50%"> |
اوپر اور نیچے کے حصے |
| 3 قطاریں | <frameset rows="15%, 75%, 10%"> |
ہیڈر، مواد، فوٹر |
| ہیڈر + کالم + فوٹر | <frameset rows="15%, 75%, 10%"> ... <frameset cols="25%, 75%"> |
ہیڈر، نیویگیشن + مواد، فوٹر |
| کالم + ہیڈر | <frameset cols="30%, 70%"> ... <frameset rows="20%, 80%"> |
نیسٹڈ فریموں کے ساتھ 2-کالم لے آؤٹ |
| غلطی | یہ کیوں غلط ہے | صحیح طریقہ |
|---|---|---|
<body> کو <frameset> کے ساتھ استعمال کرنا |
غلط HTML ڈھانچہ | یا تو <body> یا <frameset> استعمال کریں، دونوں نہیں |
<noframes> فال بیک بھول جانا |
ناقص رسائی | ہمیشہ <noframes> مواد شامل کریں |
فریموں پر name صفت غائب |
لنکس کو نشانہ بنانا کام نہیں کرے گا | ان فریموں میں name شامل کریں جنہیں آپ نشانہ بنانا چاہتے ہیں |
| فیصد کا استعمال جو 100% تک نہیں پہنچتے | لے آؤٹ کے مسائل | یقینی بنائیں کہ rows/cols کا مجموعہ 100% ہے |
<frameset> ٹیگ بند نہ کرنا |
غلط HTML | ہمیشہ </frameset> کے ساتھ بند کریں |
<frameset> براؤزر ونڈو کو قطاروں یا کالموں میں تقسیم کرتا ہے۔<frame> ہر حصے میں ایک HTML دستاویز لوڈ کرتا ہے۔name صفت مخصوص فریموں میں نشانہ بنانے والے لنکس کی اجازت دیتی ہے۔<noframes> ان براؤزرز کے لیے مواد فراہم کرتا ہے جو فریمز کو سپورٹ نہیں کرتے۔آپ نے کامیابی سے:
<frameset> اور <frame> ٹیگز کا استعمال کرتے ہوئے فریم سیٹس کے ساتھ ایک HTML ویب صفحہ بنایا۔target صفت کا استعمال کیا۔<noframes> فال بیک مواد شامل کیا۔