February 27, 201412 yr Anyone able to explain how to use percentages and em's? I'm learning to create a responsive website and I have seen loads of sites using them. How do I convert pixel into them etc? I'm wanting to create a website with a max width of 980px with a left sidebar of 640px and right sidebar of 310. How do I work out what the best font sizes work with each device?
February 28, 201412 yr Author Thank you I'm not sure what I'm doing wrong here I want a gap between the content div and the sidebar div. But When I add the percentage it connects together. Any ideas? body { background: #CCC; color: #404040; font-family: Open Sans,sans-serif; font-size: 13px; line-height: 1.5; } h1 { font-size: 34px; font-weight: bold; } .clear{ clear:both;} img{ height: auto; max-width: 100%; } #wrapper{ width: 980px; margin: 0 auto; } header { width: 980px; background-color: #FFF; height: 185px; } #content{ width: 67.36842%; margin-top: 25px; float: left; height: 650px; background-color: #FFF; } #sidebar{ width: 32.63158% ; float:right; margin-left: 24px; margin-top: 25px; background-color: #FFF; height: 650px; } <div id="wrapper"> <header> <div class="logo"> </div><!--- Logo end --> </header> <section id="content"> </section> <aside id="sidebar"> </aside> <div class="clear"></div> </div>
February 28, 201412 yr Author Yes it works thank you Do you know any responsive tutorials ? I know I need media queries to make it fit for devices (move the side bar below content for mobiles)
February 28, 201412 yr Here is a good list of standard media queries: http://css-tricks.com/snippets/css/media-queries-for-standard-devices/
Create an account or sign in to comment