Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Percentage and Em's

Featured Replies

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?

  • 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>
  • 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)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.