SlideShare una empresa de Scribd logo
1 de 8
Descargar para leer sin conexión
Intro to HTML/CSS
                Class 4 Handout: Two Column Layout w/ CSS
                           + Mobile Web Design

1. Two Column Layout

We are starting out with a two column layout. You can download the code and images here:

http://ge.tt/6YVcnPL/v/0

Unzip and open this in Aptana.

Here is the HTML code:

<!DOCTYPE html>
<html>
 <head>
  <title>Two Column Layout</title>
  <link rel="stylesheet" type="text/css" href="style.css">
  <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0,
minimum-scale=1.0, maximum-scale=1.0">
 </head>
 <body>
  <div id="wrapper">

   <div id="header">
    <h1>My Vacation Blog</h1>
    <h2>Places I like to go.</h2>
   </div>

   <ul id="nav">
    <li><a href="index.html">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Stuff</a></li>
    <li><a href="#">Contact</a></li>
   </ul>

   <div id="content">



                                                                                            1
<div class="post">
        <h3>First Post</h3>
        <img src="images/big_wave.jpg" class="pic" />
        <p>
         Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae enim ante.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
Nullam auctor, leo convallis rhoncus vestibulum, lectus justo tempor urna, egestas consequat
nisi nibh vitae magna. In auctor, erat id ornare auctor, turpis metus eleifend tellus, vel adipiscing
purus nunc lacinia turpis.
        </p>
        <p>
         Aenean consectetur turpis at justo laoreet laoreet. Sed at sapien nec enim egestas
ultricies quis vehicula elit. Quisque mattis, urna in venenatis accumsan, nisl orci facilisis diam, a
hendrerit sapien sem eget libero. Cras ultricies ligula sed magna mattis mollis at at augue.
Curabitur iaculis vulputate elementum. Maecenas quis enim est, nec egestas massa. Ut nec
neque lorem. In volutpat pellentesque lacinia. Nulla facilisi.
        </p>
       </div>

     <div class="post">
      <h3>Second Post</h3>
      <img src="images/sunset.jpg" class="pic" />
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac rutrum magna.
Maecenas ac orci ac justo dignissim fermentum. Nam sit amet sem ac est rutrum fermentum a
ac est. Pellentesque non quam dui. Aliquam ligula eros, dictum eget suscipit non, gravida a
ante.
      </p>
     </div>

       <div class="post">
        <h3>Third Post</h3>
        <img src="images/on_the_rocks.jpg" class="pic" />
        <p>
         Vivamus lacinia iaculis felis, gravida sagittis libero aliquam id. Nam faucibus porta arcu,
nec ullamcorper felis tempor euismod. Nam nec metus et velit dignissim condimentum. Nulla
quis pretium erat. Sed vel urna ac sem accumsan scelerisque. Nunc vitae risus nisi, vel
convallis libero.
        </p>
        <p>
         Ut pellentesque, nisi nec dignissim aliquam, tortor lacus tincidunt dui, et egestas augue
leo eget felis. In neque arcu, pulvinar quis imperdiet ac, facilisis a ipsum. Nam felis enim,
pellentesque sollicitudin pellentesque sed, ornare sed massa. Pellentesque habitant morbi
tristique senectus et netus et malesuada fames ac turpis egestas.
        </p>
        <p>
         Quisque aliquam placerat pharetra. Mauris vel nisi libero. Sed ut viverra dui. Maecenas
consequat velit id turpis mollis a euismod lectus viverra. Donec ullamcorper elementum
interdum. In eget lectus et tellus tristique viverra non quis sem.
        </p>


                                                                                                       2
</div>

    </div>

    <div id="sidebar">
     <div class="section">
      <h3>Sidebar Content</h3>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac rutrum magna.</p>
     </div>
     <div class="section">
      <h3>About this Site</h3>
      <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac rutrum magna.
Maecenas ac orci ac justo dignissim fermentum. Nam sit amet sem ac est rutrum fermentum a
ac est. Pellentesque non quam dui. Aliquam ligula eros, dictum eget suscipit non, gravida a
ante.
      </p>
     </div>
    </div>

  </div>
 </body>
</html>


Here is the CSS:

/*********************
Page Styles
*********************/

body {
  margin: 0;
  background: #90ADB7 url('../images/background.png') repeat-x;
  font-family: verdana, sans-serif;
  font-size: 0.85em;
}

#wrapper {
  width: 960px;
  margin: 0 auto;
}

p{
  line-height: 1.5em;
  color: #333;
}

a:hover {
  text-decoration: none;
}


                                                                                              3
/*********************
Navigation
*********************/

#nav {
  list-style: none;
  padding: 0;
  float: right;
  margin: 40px 0;
}

#nav li {
  float: left;
  margin-right: 10px;
  font-size: 1.4em;
  font-weight: bold;
}



/*********************
Header
*********************/

#header {
  font-style: italic;
  float: left;
  margin: 20px 0;
}

#header h1 {
  font-size: 3em;
  margin: 0;
}

#header h2 {
  margin: 0;
  color: #888;
  font-size: 1.2em;
}



/*********************
Content
*********************/

#content {


                         4
float: left;
    width: 700px;
    margin-right: 20px;
}

#content .post {
  background: #FFF;
  padding: 10px;
  margin-bottom: 20px;
  border: 2px solid #CCC;
}

#content .post h3 {
  margin: 0;
  color: #333;
}

.pic {
  margin-left: 10px;
  float: right;
}



/*********************
Sidebar
*********************/

#sidebar {
  float: left;
  width: 200px;
  background: #FFF;
  padding: 10px;
  border: 2px solid #CCC;
}

#sidebar h3 {
  margin: 0;
}

#sidebar .section {
  border-top: 2px dashed #CCC;
  padding-top: 10px;
}

#sidebar .section:first-child {
  border-top: none;
  padding: 0;
}

There are also some images in the zipped file in a folder called “images”.


                                                                             5
Now make your browser window really small, about the size of a smartphone screen. It doesn’t
look so great. The navigation is difficult to click, etc.




We will add the following to the CSS:

/*********************
Media Queries
*********************/

@media handheld and (max-width: 480px),
  screen and (max-device-width: 480px),
  screen and (max-width: 600px) {

 #wrapper, #content {
   width: inherit;
 }

 #sidebar {
   display: none;
 }

 #header {
   float: none;
   margin: 0px;
 }

 #header h1 {



                                                                                               6
text-align: center;
        font-size: 2em;
        margin: 5px;
    }

    #header h2 {
      display: none;
    }

    #nav {
      font-size: 0.75em;
      margin: 5px;
      float: none;
      padding: 4px 0px;
      text-align: center;
      background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#A5C6D1), to(#6A8087));
      border-bottom: 1px solid #555;
      -webkit-border-radius: 8px;
    }

    #nav li {
      float: none;
      display: inline;
      margin: 0;
    }

    #nav li a {
      padding: 4px;
      padding-left: 6px;
      text-decoration: none;
      text-shadow: 0px -1px 1px rgba(0,0,0,0.5);
      color: #FFF;
      border-left: 1px solid #CCC;
    }

    #nav li:first-child a {
      border-left: none;
    }

    #content {
      margin: 5px;
    }

    .pic {
      margin: 10px auto;
      display: block;
      float: none;
    }

}



                                                                                          7
Now look at your browser again. It should look better for mobile devices.




The finished exercise file is here:
http://ge.tt/6SLuoPL/v/0

You can read more about media queries here:

http://www.w3.org/TR/css3-mediaqueries/




                                                                            8

Más contenido relacionado

La actualidad más candente

Responsive Web Design & Typography
Responsive Web Design & TypographyResponsive Web Design & Typography
Responsive Web Design & TypographyDanny Calders
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える拓樹 谷
 
Earn money with banner and text ads for Clickbank
Earn money with banner and text ads for ClickbankEarn money with banner and text ads for Clickbank
Earn money with banner and text ads for ClickbankJaroslaw Istok
 
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...Nicholas Dionysopoulos
 
Earn money with banner and text ads for clickbank
Earn money with banner and text ads for clickbankEarn money with banner and text ads for clickbank
Earn money with banner and text ads for clickbankJaroslaw Istok
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesAndy Wallace
 
In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how... In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how... British Council
 
Joomla! Day UK 2009 Menus Presentation
Joomla! Day UK 2009 Menus PresentationJoomla! Day UK 2009 Menus Presentation
Joomla! Day UK 2009 Menus PresentationAndy Wallace
 
Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本a5494535
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事Sofish Lin
 
i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016Sergey Biryukov
 
LESS is More
LESS is MoreLESS is More
LESS is Morejsmith92
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Mark Wubben
 
2016 First steps with Angular 2 – enterjs
2016 First steps with Angular 2 – enterjs2016 First steps with Angular 2 – enterjs
2016 First steps with Angular 2 – enterjsGeilDanke
 

La actualidad más candente (20)

Responsive Web Design & Typography
Responsive Web Design & TypographyResponsive Web Design & Typography
Responsive Web Design & Typography
 
Handout3 links
Handout3 linksHandout3 links
Handout3 links
 
モダンなCSS設計パターンを考える
モダンなCSS設計パターンを考えるモダンなCSS設計パターンを考える
モダンなCSS設計パターンを考える
 
Wiidget
WiidgetWiidget
Wiidget
 
Earn money with banner and text ads for Clickbank
Earn money with banner and text ads for ClickbankEarn money with banner and text ads for Clickbank
Earn money with banner and text ads for Clickbank
 
Tmx9
Tmx9Tmx9
Tmx9
 
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
Joomla! Frappe - Κατασκευή εφαρμογών για το Joomla! χωρίς να τραβάτε τα μαλιά...
 
Earn money with banner and text ads for clickbank
Earn money with banner and text ads for clickbankEarn money with banner and text ads for clickbank
Earn money with banner and text ads for clickbank
 
Joomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic TemplatesJoomla! Day UK 2009 Basic Templates
Joomla! Day UK 2009 Basic Templates
 
In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how... In some simple steps, your site can stand out from the rest. Here's how...
In some simple steps, your site can stand out from the rest. Here's how...
 
Joomla! Day UK 2009 Menus Presentation
Joomla! Day UK 2009 Menus PresentationJoomla! Day UK 2009 Menus Presentation
Joomla! Day UK 2009 Menus Presentation
 
Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本Simple Blue Blog Template XML 的副本
Simple Blue Blog Template XML 的副本
 
LESS
LESSLESS
LESS
 
Theme 23
Theme 23Theme 23
Theme 23
 
关于 Html5 那点事
关于 Html5 那点事关于 Html5 那点事
关于 Html5 那点事
 
i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016i18n for Plugin and Theme Developers, WordCamp Milano 2016
i18n for Plugin and Theme Developers, WordCamp Milano 2016
 
LESS is More
LESS is MoreLESS is More
LESS is More
 
Word Camp Fukuoka2010
Word Camp Fukuoka2010Word Camp Fukuoka2010
Word Camp Fukuoka2010
 
Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>Bringing Typography to the Web with sIFR 3 at <head>
Bringing Typography to the Web with sIFR 3 at <head>
 
2016 First steps with Angular 2 – enterjs
2016 First steps with Angular 2 – enterjs2016 First steps with Angular 2 – enterjs
2016 First steps with Angular 2 – enterjs
 

Destacado

Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Erin M. Kidwell
 
Memory error-talk
Memory error-talkMemory error-talk
Memory error-talkJay Thakkar
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseRalf Sternberg
 
Sich erfolgreich bewerben
Sich erfolgreich bewerbenSich erfolgreich bewerben
Sich erfolgreich bewerbenCornel Müller
 

Destacado (6)

Timms group 2 (2)
Timms group 2 (2)Timms group 2 (2)
Timms group 2 (2)
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
Girl Develop It Cincinnati: Intro to HTML/CSS Class 2
 
Learn Java 3D
Learn Java 3D Learn Java 3D
Learn Java 3D
 
Memory error-talk
Memory error-talkMemory error-talk
Memory error-talk
 
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code baseSingle Sourcing RAP and RCP - Desktop and web clients from a single code base
Single Sourcing RAP and RCP - Desktop and web clients from a single code base
 
Sich erfolgreich bewerben
Sich erfolgreich bewerbenSich erfolgreich bewerben
Sich erfolgreich bewerben
 

Similar a Class 4 handout two column layout w mobile web design

Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxzainm7032
 
Lesson1 - Fall 2013
Lesson1 - Fall 2013Lesson1 - Fall 2013
Lesson1 - Fall 2013hstryk
 
I pv6+at+caribbean+sector
I pv6+at+caribbean+sectorI pv6+at+caribbean+sector
I pv6+at+caribbean+sectormax Firmin
 
Responsive Email Design and Development
Responsive Email Design and DevelopmentResponsive Email Design and Development
Responsive Email Design and Developmentladyheatherly
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...Mario Heiderich
 
What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from AustinLisa Adkins
 
IT1150CapstoneProjectFall2016TedCarr
IT1150CapstoneProjectFall2016TedCarrIT1150CapstoneProjectFall2016TedCarr
IT1150CapstoneProjectFall2016TedCarrTed Carr
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by MukeshMukesh Kumar
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To PracticeSergey Bolshchikov
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBen Limmer
 
HTML5: Markup Evolved
HTML5: Markup EvolvedHTML5: Markup Evolved
HTML5: Markup EvolvedBilly Hylton
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Wahyu Putra
 
RWD in the Wild
RWD in the WildRWD in the Wild
RWD in the WildRich Quick
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebEduardo Shiota Yasuda
 

Similar a Class 4 handout two column layout w mobile web design (20)

Lect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptxLect-4-Responsive-Web-06032024-082044am.pptx
Lect-4-Responsive-Web-06032024-082044am.pptx
 
Lesson1 - Fall 2013
Lesson1 - Fall 2013Lesson1 - Fall 2013
Lesson1 - Fall 2013
 
I pv6+at+caribbean+sector
I pv6+at+caribbean+sectorI pv6+at+caribbean+sector
I pv6+at+caribbean+sector
 
Responsive Email Design and Development
Responsive Email Design and DevelopmentResponsive Email Design and Development
Responsive Email Design and Development
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...
Copy & Pest - A case-study on the clipboard, blind trust and invisible cross-...
 
What I brought back from Austin
What I brought back from AustinWhat I brought back from Austin
What I brought back from Austin
 
IT1150CapstoneProjectFall2016TedCarr
IT1150CapstoneProjectFall2016TedCarrIT1150CapstoneProjectFall2016TedCarr
IT1150CapstoneProjectFall2016TedCarr
 
Bootstrap PPT by Mukesh
Bootstrap PPT by MukeshBootstrap PPT by Mukesh
Bootstrap PPT by Mukesh
 
Css web gallery
Css web galleryCss web gallery
Css web gallery
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
Html5 intro
Html5 introHtml5 intro
Html5 intro
 
Building a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profitBuilding a Single Page Application using Ember.js ... for fun and profit
Building a Single Page Application using Ember.js ... for fun and profit
 
HTML5: Markup Evolved
HTML5: Markup EvolvedHTML5: Markup Evolved
HTML5: Markup Evolved
 
Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3Create Responsive Website Design with Bootstrap 3
Create Responsive Website Design with Bootstrap 3
 
RWD in the Wild
RWD in the WildRWD in the Wild
RWD in the Wild
 
Responsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da WebResponsive Web Design e a Ubiquidade da Web
Responsive Web Design e a Ubiquidade da Web
 
Ocul emergency-presentation
Ocul emergency-presentationOcul emergency-presentation
Ocul emergency-presentation
 

Más de Erin M. Kidwell

Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...Erin M. Kidwell
 
Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Erin M. Kidwell
 
Class 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheetClass 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheetErin M. Kidwell
 
Class 1 handout (2) html exercises
Class 1 handout (2) html exercisesClass 1 handout (2) html exercises
Class 1 handout (2) html exercisesErin M. Kidwell
 
Class 1 handout (1) aptana create a new presentation and stylesheet
Class 1 handout (1) aptana  create a new presentation and stylesheetClass 1 handout (1) aptana  create a new presentation and stylesheet
Class 1 handout (1) aptana create a new presentation and stylesheetErin M. Kidwell
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1Erin M. Kidwell
 

Más de Erin M. Kidwell (7)

Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...Class 3 Intro to HTML/ CSS Gdi cincinnati   create a table layout with html (...
Class 3 Intro to HTML/ CSS Gdi cincinnati create a table layout with html (...
 
Class 2 handout css exercises (2)
Class 2 handout css exercises (2)Class 2 handout css exercises (2)
Class 2 handout css exercises (2)
 
Class 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheetClass 2 handout (1) adding a css stylesheet
Class 2 handout (1) adding a css stylesheet
 
Class 1 handout (2) html exercises
Class 1 handout (2) html exercisesClass 1 handout (2) html exercises
Class 1 handout (2) html exercises
 
Class 1 handout (1) aptana create a new presentation and stylesheet
Class 1 handout (1) aptana  create a new presentation and stylesheetClass 1 handout (1) aptana  create a new presentation and stylesheet
Class 1 handout (1) aptana create a new presentation and stylesheet
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
Girl Develop It Cincinnati: Intro to HTML/CSS Class 1
 

Último

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Class 4 handout two column layout w mobile web design

  • 1. Intro to HTML/CSS Class 4 Handout: Two Column Layout w/ CSS + Mobile Web Design 1. Two Column Layout We are starting out with a two column layout. You can download the code and images here: http://ge.tt/6YVcnPL/v/0 Unzip and open this in Aptana. Here is the HTML code: <!DOCTYPE html> <html> <head> <title>Two Column Layout</title> <link rel="stylesheet" type="text/css" href="style.css"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0"> </head> <body> <div id="wrapper"> <div id="header"> <h1>My Vacation Blog</h1> <h2>Places I like to go.</h2> </div> <ul id="nav"> <li><a href="index.html">Home</a></li> <li><a href="#">About</a></li> <li><a href="#">Stuff</a></li> <li><a href="#">Contact</a></li> </ul> <div id="content"> 1
  • 2. <div class="post"> <h3>First Post</h3> <img src="images/big_wave.jpg" class="pic" /> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vitae enim ante. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam auctor, leo convallis rhoncus vestibulum, lectus justo tempor urna, egestas consequat nisi nibh vitae magna. In auctor, erat id ornare auctor, turpis metus eleifend tellus, vel adipiscing purus nunc lacinia turpis. </p> <p> Aenean consectetur turpis at justo laoreet laoreet. Sed at sapien nec enim egestas ultricies quis vehicula elit. Quisque mattis, urna in venenatis accumsan, nisl orci facilisis diam, a hendrerit sapien sem eget libero. Cras ultricies ligula sed magna mattis mollis at at augue. Curabitur iaculis vulputate elementum. Maecenas quis enim est, nec egestas massa. Ut nec neque lorem. In volutpat pellentesque lacinia. Nulla facilisi. </p> </div> <div class="post"> <h3>Second Post</h3> <img src="images/sunset.jpg" class="pic" /> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac rutrum magna. Maecenas ac orci ac justo dignissim fermentum. Nam sit amet sem ac est rutrum fermentum a ac est. Pellentesque non quam dui. Aliquam ligula eros, dictum eget suscipit non, gravida a ante. </p> </div> <div class="post"> <h3>Third Post</h3> <img src="images/on_the_rocks.jpg" class="pic" /> <p> Vivamus lacinia iaculis felis, gravida sagittis libero aliquam id. Nam faucibus porta arcu, nec ullamcorper felis tempor euismod. Nam nec metus et velit dignissim condimentum. Nulla quis pretium erat. Sed vel urna ac sem accumsan scelerisque. Nunc vitae risus nisi, vel convallis libero. </p> <p> Ut pellentesque, nisi nec dignissim aliquam, tortor lacus tincidunt dui, et egestas augue leo eget felis. In neque arcu, pulvinar quis imperdiet ac, facilisis a ipsum. Nam felis enim, pellentesque sollicitudin pellentesque sed, ornare sed massa. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. </p> <p> Quisque aliquam placerat pharetra. Mauris vel nisi libero. Sed ut viverra dui. Maecenas consequat velit id turpis mollis a euismod lectus viverra. Donec ullamcorper elementum interdum. In eget lectus et tellus tristique viverra non quis sem. </p> 2
  • 3. </div> </div> <div id="sidebar"> <div class="section"> <h3>Sidebar Content</h3> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac rutrum magna.</p> </div> <div class="section"> <h3>About this Site</h3> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac rutrum magna. Maecenas ac orci ac justo dignissim fermentum. Nam sit amet sem ac est rutrum fermentum a ac est. Pellentesque non quam dui. Aliquam ligula eros, dictum eget suscipit non, gravida a ante. </p> </div> </div> </div> </body> </html> Here is the CSS: /********************* Page Styles *********************/ body { margin: 0; background: #90ADB7 url('../images/background.png') repeat-x; font-family: verdana, sans-serif; font-size: 0.85em; } #wrapper { width: 960px; margin: 0 auto; } p{ line-height: 1.5em; color: #333; } a:hover { text-decoration: none; } 3
  • 4. /********************* Navigation *********************/ #nav { list-style: none; padding: 0; float: right; margin: 40px 0; } #nav li { float: left; margin-right: 10px; font-size: 1.4em; font-weight: bold; } /********************* Header *********************/ #header { font-style: italic; float: left; margin: 20px 0; } #header h1 { font-size: 3em; margin: 0; } #header h2 { margin: 0; color: #888; font-size: 1.2em; } /********************* Content *********************/ #content { 4
  • 5. float: left; width: 700px; margin-right: 20px; } #content .post { background: #FFF; padding: 10px; margin-bottom: 20px; border: 2px solid #CCC; } #content .post h3 { margin: 0; color: #333; } .pic { margin-left: 10px; float: right; } /********************* Sidebar *********************/ #sidebar { float: left; width: 200px; background: #FFF; padding: 10px; border: 2px solid #CCC; } #sidebar h3 { margin: 0; } #sidebar .section { border-top: 2px dashed #CCC; padding-top: 10px; } #sidebar .section:first-child { border-top: none; padding: 0; } There are also some images in the zipped file in a folder called “images”. 5
  • 6. Now make your browser window really small, about the size of a smartphone screen. It doesn’t look so great. The navigation is difficult to click, etc. We will add the following to the CSS: /********************* Media Queries *********************/ @media handheld and (max-width: 480px), screen and (max-device-width: 480px), screen and (max-width: 600px) { #wrapper, #content { width: inherit; } #sidebar { display: none; } #header { float: none; margin: 0px; } #header h1 { 6
  • 7. text-align: center; font-size: 2em; margin: 5px; } #header h2 { display: none; } #nav { font-size: 0.75em; margin: 5px; float: none; padding: 4px 0px; text-align: center; background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#A5C6D1), to(#6A8087)); border-bottom: 1px solid #555; -webkit-border-radius: 8px; } #nav li { float: none; display: inline; margin: 0; } #nav li a { padding: 4px; padding-left: 6px; text-decoration: none; text-shadow: 0px -1px 1px rgba(0,0,0,0.5); color: #FFF; border-left: 1px solid #CCC; } #nav li:first-child a { border-left: none; } #content { margin: 5px; } .pic { margin: 10px auto; display: block; float: none; } } 7
  • 8. Now look at your browser again. It should look better for mobile devices. The finished exercise file is here: http://ge.tt/6SLuoPL/v/0 You can read more about media queries here: http://www.w3.org/TR/css3-mediaqueries/ 8