Question: I've written an open source Rack app and core lirary to stream stock quotes from Tradeking.com. Here's the rack app: <https://github.com/chaddjohnson/trading_websocket_service>. And here's the core library: <https://github.com/chaddjohnson/trading_core>.

I modified trading\_core/lib/trading\_core/quote\_streamer/tradeking.rb to output streamed data to the console, as so:

```
@http.stream do |data|
  puts data

```

After a few hours of it streaming and outputting to the console, it simply freezes. I have absolutely no idea why. I've done my best to ensure that any loops are not infinite. I've been debugging this for over a week now.

Any ideas why this is happening?

Here are the main files where I think this could be happening:

* <https://github.com/chaddjohnson/trading_core/blob/master/lib/trading_core/client_data_broker.rb>
* <https://github.com/chaddjohnson/trading_core/blob/master/lib/trading_core/quote_streamer/tradeking.rb>
* <https://github.com/chaddjohnson/trading_websocket_service/blob/master/lib/web_socket_service.rb>

Answer: 
You need to set up media queries. 

Media Queries let you define CSS rules based on the way the page is being rendered. So lets say your page breaks when the window is smaller than 1024px.

```
.myClass { 

    //Default rules for .myClass

    font-size:18px;
  }

@media (max-width: 1024px) { 
    // The rules in here only apply if the window is less than/equal to 1024px
    // So we'll drop the font size so that it fits the smaller screen

  .myClass {
    font-size:12px;
  }
}

```

I made a JSFiddle [here.](http://jsfiddle.net/rwVKL/) The media query bases the width off the width of the "Result" frame, so slide that around to make it wider/narrower to see how it works.
Its always recommended to use `%` for container.You no need to put more effort on this, just apply `%` instead of `px`.
Example :- 

```
<div style="widht:100%;height:40%;">
    <div>
      <font size="20px">Hi Mate</font>
    </div>
 <div>
      <font size="20px">How are you</font>
    </div>
</div>

```

Here the outer `<div>` is the container ,which should be in `%` . Its working for me, I have designed more than 5 web site. The text size will automatically change with respective browser .

Hope it will help you.