Working with CSS I am constantly trying to convert RGB values from Photoshop to their hex equivalent. There is probably a setting in PhotoShop that I have missed, but the following small form will quickly convert RGB values to the HEX equivalent. You can then use these values in CSS with # at the beginning.
Let me know if you find this useful:
great tool for hex codes