https://example.com/tutorials/html https://example.com/tutorials/java https://example.com/tutorials/jquery
다음은 구문입니다 -
<base href="absolute_URL">
위의 절대 _URL은 기본 URL의 절대 URL입니다. 이제
예시
<!DOCTYPE html> <html> <head> <base href="https://www.example.com/tutorials/"> </head> <body> <h2>Tutorials List</h2> <p><a href="java.html">Java Tutorial</a></p><p>(This will act as https://www.example.com/tutorials/java.html)</p> <p><a href="jquery.html">jQuery Tutorial</a></p><p>(This will act as https://www.example.com/tutorials/jquery.html)</p> <p><a href="blockchain.html">Blockchain Tutorial</a></p><p>(This will act as https://www.example.com/tutorials/blockchain.html)</p> <p><a href="python.html">Python Tutorial</a></p><p>(This will act as https://www.example.com/tutorials/python.html)</p> </body> </html>
출력
위의 예에서 기본 URL을 -
로 설정했습니다.<base href="https://www.example.com/tutorials/">
링크를 "java.html ", 그것은 결국 -
https://www.example.com/tutorials/java.html