Myanmar Coder Guide

Course Outline from w3school.com

Tuesday, January 5, 2021

HTML File Paths

HTML File Paths

File pathတစ်ခု ဆိုတာက website တစ်ခုရဲ့ folder ထဲမှာ ရှိတဲ့ fileတစ်ခုရဲ့ တည်နေရာ ကို ဖော်ပြပါတယ်။

File Path Examples

Path Description
< img src="picture.jpg" > ယခုလက်ရှိ runနေတဲ့ web page နဲ့ picture.jpg file နဲ့က တူညီတဲ့ folderထဲမှာ ရှိပါတယ်။
< img src="images/picture.jpg" > Project folder ထဲက images folderထဲမှာ picture.jpg fileရှိပါတယ်။
< img src="/images/picture.jpg" > လက်ရှိrunနေတဲ့ web page ရှိတဲ့ folder ထဲက images အမည်နဲ့ folderထဲမှာ ''picture.jpg'' file ရှိပါတယ်။
< img src="../picture.jpg" > လက်ရှိrunနေတဲ့ web page ရှိတဲ့ folder ထဲမှာမဟုတ်ပဲ အပြင်folder တစ်ခုမှာ ''picture.jpg'' file ရှိပါတယ်။

HTML File Paths

File pathတစ်ခု ဆိုတာက website တစ်ခုရဲ့ folder ထဲမှာ ရှိတဲ့ fileတစ်ခုရဲ့ တည်နေရာ ကို ဖော်ပြပါတယ်။

External files တွေနဲ့ linkချိတ်တဲ့အခါမှာလည်း file pathsတွေကို သုံးပါတယ်။External filesတွေကတော့-

  • Web pages
  • Images
  • Style sheets
  • JavaScripts

Absolute File Paths

An absolute file path ဆိုတာကတော့ fileတစ်ခုကို ချိတ်တဲ့ လမ်းကြောင်း (URL) အပြည့်အစုံ ဖြစ်ပါတယ်။

Example

  1. <img src="https://www.w3schools.com/images/picture.jpg" alt="Mountain">
Try it yourself

Relative File Paths

A relative file path ဆိုတာက လက်ရှိweb pageရဲ့ဆက်စပ်နေတဲ့ fileတစ်ခုကို ညွန်းပါတယ်။

အောက်ပါexampleအရ ၊ project folder ထဲမှာ ရှိတဲ့ images folder ထဲက file လမ်းကြောင်းကို ညွန်းပါတယ်။

Example

  1. <img src="/images/picture.jpg" alt="Mountain" >
Try it yourself

အောက်ပါexampleအရ ၊လက်ရှိrunနေတဲ့ web page ရှိတဲ့ folder ထဲက images အမည်နဲ့ folderထဲမှာ file လမ်းကြောင်းကို ညွန်းပါတယ်။

Example

  1. < img src="images/picture.jpg" alt="Mountain" >
Try it yourself

အောက်ပါexampleအရ ၊လက်ရှိrunနေတဲ့ web page ရှိတဲ့ folder ထဲမှာမဟုတ်ပဲ အပြင်folder တစ်ခုက file လမ်းကြောင်းကို ညွန်းပါတယ်။

Example

  1. <img src="../images/picture.jpg" alt="Mountain" >
Try it yourself

No comments:

Post a Comment