For the most part, if you are visiting standard sites that employ pure HTML coding you should be very safe. Sites that use Java, and other binary control files may offer some risk. Sincere systems, and site operators do their best to have good clean code.
Most sites are for serious business, and are very careful to be safe for all visitors.
The key is not to download any programs or executable files, unless you are very sure about the security of the site that is offering these programs. It is very hard for system operators who have large banks of programs, to offer to take responsibility for each file that is available. If you are the adventuring type that likes to download a lot of free programs, it is suggested strongly to have a good antivirus program. There are a number of good ones out there. You should shop around to see which one you feel comfortable to use.