I pulled over and retightened the cap, the light did not go off. I tried to redo it again and shut the car off to reset the computer and restart the light still remained on. This car is a 2011 Nissan Altima
What causes the loose fuel cap light to come on when the gas cap is tight
on 2011 Nissan Altima
Faulty cap ,as wetry said , or large EVAP leak, fuel tank side of system. If cap doesn't fix it (may take several drive cycles for light to clear itself if you don't have scanner to do that) , then it should be diagnosed properly.<<<<<<<<<<<<<>>>>>>>>>>>>>>.........2011? Emissions system should be a warranty issue unless more than 80K , be sure to check your warranty book that came with the car (maybe one specifically for emissions).
either faulty cap...or leak in EVAP system...try changing the cap first before heading to a qualified shop.