Creating a webpage that changes based on data from a sensor.

I am starting out basic right now but basically what I want to do if say a mq-2 gas sensor senses said amount of gas then the webpage turns red. If it wasn't enough gas it is white. This is java but where I am struggling is how to upload the sensor data to the website. Any ideas or good youtube videos. Thanks