views:

181

answers:

4

Can somebody please tell me how to add alt text to images on firebug?

A: 

Inspect the image with Firebug then right click the element and do add attribute that will allow you to add an alt attribute which is the alt text. But just wondering what exactly are you trying to accomplish as you can save work out of firebug.

Firebug is only a client side editor it will not allow you to get work back onto your site. You can test edits just for you with firebug when you are happy make the same changes in the HTML file you are viewing.

In your case you will need to look at the shopping carts html and find the img tag you want to edit then add the alt attribute there.

Jeff Beck
I was right clicking on the image in my shopping cart, then inspect element, (firebug automatically comes up) (the info on the image is highlighted) click edit (top left) put in the alt="bath mat etc"/> and save. When you check back the details just typed in are not there so hmmmm don't know is there another way?
Katrina Foulkes-Taylor
I updated the answer hope that helps.
Jeff Beck
Have been to my coreftp and can't find cart images only web page images, have then been to cart and this seems to be the only place for the individual product photo's so must be another way from here . Do you have any more suggestions or do you need a wine like me?
Katrina Foulkes-Taylor
What are you using for a shopping cart? Or can you post a link to the page you are working on?
Jeff Beck
Katrina Foulkes-Taylor
It seems that the page the images are being displayed on is built from the Gate13 software so you would need to either edit the program generating the shopping cart or contact the vendor with how to add alt text to your pictures. It may not be supported by that tool. Looking around the site in the details view of a curtain they had alt text but not on the display of many items. I'm not sure exactly where you wanted to add alt text but the best option is to contact your vendor at this point.
Jeff Beck
A: 

You can use the element inspector from the Firebug control panel (2nd icon from the top left of the menu, next to the firebug logo icon). Click on that, then on the image you want to edit. Then in the right-hand pane, select the DOM tab, and find the alt attribute. Double-click the value field, and enter the alt value you'd like.

Any changes you make in Firebug aren't permanent of course, and disappear when you refresh the page. You'll have to copy them into the HTML to save them.

zombat
Hmmm OK so how do I copy them into the html and does this mean I don't use firebug at all. I am in my shopping cart back end and when I right click the image then inspect element it comes up automatically. I have a basic understanding of my html and made quite a few changes recently. Thank you so much for your help.
Katrina Foulkes-Taylor
Firebug's primary purpose is to be a debugging tool. It lets you examine things and make small changes in situ, but it does not modify source code. In order to permanently add alt tags you will have to edit the HTML source files themselves.
zombat
A: 

I answer to your comments, not to your main question, correctly answered above and not useful to your need...

In Firefox, you don't do Inspect image to get its URL, as you saw, but select Properties: it will give you full path, under Image Properties if there is a link on the image (like on the Stack Overflow logo at the top of this page as I write: I can see http://sstatic.net/so/img/logo.png URL).
Unless the image is defined in CSS, ie. as background, making it harder to find out (Firebug can help here).

Beside, your shopping cart page is probably defined in a template (you haven't told us what software you use). For example, in Zen Cart, you can find a file at <root of shop>/includes/templates/template_default/info_shopping_cart/tpl_main_page.php but it can be instead in <root of shop>/includes/templates/<some template name>/info_shopping_cart/tpl_main_page.php if you use another template. And the part of interest can actually been in another file which is included by the main file, or even, if coding is a bit sloppy, hard-coded in some PHP (or other language) file...

In this case, once you located the image in Firebug, look around: does your image, or some tag near it, have an ID? Or some class, eg. class="banner leftside"?
Searching a fragment of HTML like this with some recursive grep facility can help in locating the file to change. With some traps, since for example classes can be generated too (ie. you can find in the code something like: class="banner <?php echo $columnSide; ?>").

And follow the instructions on customizing your cart (if any). If well made, it offers to created a custom template by copying only the changed files under another folder. You must avoid, if possible, to modify the files provided out of the box, as they can be overwritten when upgrading the software.

HTH.

PhiLho
I will go an have a look at properties now thank you very much for your time. Here is my website you may have some suggestions (it is new) http://www.thehousequeen.com.au
Katrina Foulkes-Taylor
A: 

Using firebug find something specific in your shopping card code. Like an id=<something special> or class=<something special> near that image.

Then search for this <something special> in your project. That will give you the place where alt should be put.

PS If you're unsure which <something special> to choose, paste here some context of your page (because the link you gave isn't readable from outside).

PPS To search in a number of files, click 'Start'->'Search'->'For files and folders'->'A word or phrase in a file' and choose the directory of your project.

Antony Hatchkins
Katrina Foulkes-Taylor