user2569524
user2569524

Reputation: 1751

Changing website layout based on screen size and browser window size in Rails

I have a website that's working on 1200px(large desktop) screen. Now I would like this to be worked on different screen sizes and browser window sizes.

Issue : When I reduce the screen size, some tabs that are on my website go invisible.

How do we do it in Rails. I have searched and found out that CSS - media is the only way to do it . This way we have to write different css files for each screen size. Is there an efficient way to do this in rails? .As in, size of the elements change dynamically based on the screen size with out the change of CSS files?

Thanks!

Upvotes: 0

Views: 11538

Answers (2)

Ritesh kukreja
Ritesh kukreja

Reputation: 109

This might solve your problem..however i am not sure but it wont hurt to give it a shot... This will resize your website accordingly you device size.

<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 

Add these in your between HEAD tags

Upvotes: 1

Artiwarah Damrongchai
Artiwarah Damrongchai

Reputation: 79

I think Twitter bootstrap is an easy way to create responsive website.

This is Twitter bootstrap gem for Rails.

And this is Basic tutorial (Railscasts).

So you can follow the tutorial to get start and you can do it in advance when you understand how it work.

Upvotes: 1

Related Questions