If a university is accredited for ground campus based degrees, then obtaining an online degree from the same institution gives the most benefit. Also, you've to go by the experience of others.
Most universities today offer online classes. If you are enrolled in a university and take an online course, the course definitely will count towards your degree. However, if you take classes from an online college, and then want to transfer to a traditional four-year university, it is possible that not all your online credits will transfer. Particularly if the online college is not accredited or if the courses are not ones that the university will accept then you lose out. This is a reasonably good online resource on online college, http://www.onlinecollege247.com