While in Malaga I got an idea to rent a car for a day and drive through the coast of Spain to Gibraltar. However, I had heard stories about getting stuck in the line at the border, so I decided not to drive into Gibraltar. Instead, I left my car at the Spanish side. You can park in La Linea and walk across the border. There is free parking around the stadium.
Have a look at the map below:
After crossing the border, you will find a bus number 5 which will take you to the city. A one-way ticket costs 2 euros. I was happy that I decided to leave my car at the Spanish side as I realized that the roads are very narrow in Gibraltar. Get off at the last stop, and from there you can walk to the cable car and visit the famous Rock of Gibraltar.