This is driving me nuts – I want to just display a hash symbol (#) in html but it just won’t show it.
I’ve tried # but nothing shows.
I want to put it at the start of my title tag like so:
<img src="<?php echo $fields->image; ?>" alt="<?php echo $fields->dish_name; ?>" height="160" width="314" title="# <?php echo $fields->dish_number; ?> <?php echo $fields->dish_name; ?>" />
Update:
http://www.orientalcatering.co.uk/v1/
This is the page I’m working on, it’s the second slider towards the bottom right of the page that I’m trying to get a comment up in (you use the title tag to do this).
#is the HTML entity for the#symbol.Also you can simplify:
to just:
After reading your responses to my answer it is clear you have asked the wrong question, you are not having trouble with the
titleattribute per-say but rather you have used it incorrectly in attempting to set up your Nivo Slider.To add a caption to a Slide in Nivo slider you give it a title that references the id of a div (note the div must have the class
nivo-html-caption, and be outside of yourimgtag), e.g.The
titleattribute is used mainly for supplementary information about the contents or purpose of an element. In most modern browsers hovering over an image will reveal it’s title attribute. This is often taken advantage of in Javascript as you have seen as a way to pass more data, but each script will have it’s own method of implementation.