First of I'll assume that by computer science you really mean software engineering, more specifically network and web applications engineering. Otherwise if you want deep CS foundations start by getting a good CS theory book (Sipser or Hopcroft et Al.), and a good algorithms book(Skiena or Cormen), and complement them with some introductory logic(phil/math introductions are generally good enough).
For the "how does the web work question", the real question is if you are really interested in knowing that, if so "Computer Networking: A Top-Down Approach" gives a really in depth analysis of protocols at the different levels of abstraction. Otherwise most web related O'Reilly books cover the surface of what you need to know to develop applications at most small corporations.