Reputation: 4666
I have this code. What does the square brackets do?
<img src="[url]images/templates/logo_1.gif">
Upvotes: 1
Views: 3126
Reputation: 1031
Its like a way by the arthur of saying "Insert correct data here". Because the arthur dont know the domainname of your website.
The value of src has to point to the image file (logo_1.gif) where ever it is.
Here are some examples.
<img src="http://example.com/images/templates/logo_1.gif">
<img src="https://example.com/images/templates/logo_1.gif">
<img src="//images/templates/logo_1.gif">
<img src="/images/templates/logo_1.gif">
<img src="../images/templates/logo_1.gif">
You can write the full address with domainname (example.com) and all but you dont have to if your HTML file and image file are on the same domain.
I prefer this way.
<img src="/images/templates/logo_1.gif">
Lets say you wanted to show a image from another website that is not on the same domain as the HTML file you would have to write this way.
<img src="http://otherdomain.com/images/templates/logo_1.gif">
Upvotes: 1
Reputation: 2839
There is no actual use of square brackets, they are just mere representation where one needs to add actual image url.
Lets say some Syntax for defining an image:
<img src="url" alt="some_text">
So here you need to add actual image url instead of "url" and some alternating text for "some_text"
You can refer to w3schools for related details.
Upvotes: 2
Reputation: 11
The square brackets here stand for the url or simply the address of the website from which u are using the image into ur website.. [URL]='Www.anywebsite.domain' If the picture is onto ur computer u simply give the location of the image in the arc attribute.. src="c:\pictures\picture.jpg" So there is nothing big in the brackets :)
Its just the address of the image on the internet.. I hope u are satisfied with my answer..
Upvotes: 1
Reputation: 41223
I imagine this is in a piece of documentation.
The writer is telling you to replace [url]
with the front part of a URL.
Upvotes: 1