If I paste the code from a file into index.html and try to access it from browser is working BUT if I try to transfer the file with WinSCP into /var/www/html directory I get "403 Forbidden; You don't have permission to access". I also tried to copy the file with root login or a user made without root access + chown the /var/www/html directory to root, apache, nothing worked. What could be the problem?
Frequently such problems find their origin in SELinux security context violations.
Try for instance
restorecon -R /var/www/html/