HTML - attributes - src

revision:


Content

"src" attribute : specifies location of external source syntax some examples


"src" attribute : specifies location of external source

top

The src attribute specifies the location (URL) of the external resource.

The src attribute can be used on the following elements: <audio>, <embed>, <iframe>, <img>, <input>, <script>, <source>, <track>, <video>


syntax

top

<element src="url"></element>

url indicating a file or resource. There are two types of URL links: absolute URL points to another webpage and relative URL points to other files of the same web page.


some examples

top

Click on the play button to play a sound:

codes:
                    <p class="spec">Click on the play button to play a sound:</p>                                                     
                    <audio style="margin-left:3vw;" src="../../pics/horse.wav" controls>
                        Your browser does not support the audio element.
                    </audio>
                

Click on the image, and the input will be sent to a page on the server called "/action_page.php".



codes:
                    <p class="spec">Click on the image, and the input will be sent to a page
                    on the server called "/action_page.php".</p>
                    <form style="margin-left:3vw;" action="/action_page.php">
                    <label for="fname">First name:</label>
                    <input type="text" id="fname" name="fname"><br><br>
                    <input type="image" src=",,.../pics/submit.gif" alt="Submit" width="24" height="24">
                    </form>