Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Building a first mobile web page

From: Mobile Web Design & Development Fundamentals

Video: Building a first mobile web page

Well, we've installed our local web server and we've downloaded our emulators and made sure that we can contact our local web server so that we can see files in the emulators, and we've downloaded some tools that we are going to be using in the course. We've reached the point now where we can go ahead and try out our first mobile web page. So here I am in my code editor, and I've got my first_mobile_start.html file open from Chapter 3, and this is the ExampleSnippets file that I'll be using so you can follow along.

Building a first mobile web page

Well, we've installed our local web server and we've downloaded our emulators and made sure that we can contact our local web server so that we can see files in the emulators, and we've downloaded some tools that we are going to be using in the course. We've reached the point now where we can go ahead and try out our first mobile web page. So here I am in my code editor, and I've got my first_mobile_start.html file open from Chapter 3, and this is the ExampleSnippets file that I'll be using so you can follow along.

Now before we actually go ahead and edit our file and try it out in the emulators, let's take a look at how the workflow is going to work. So let's go to the file system really quick. Okay, here in the Desktop I've got my Exercise Files folder right here, and I've got it open in this window here. And then remember earlier when we were setting up the local web server we copied the example files over to the local web server's root folder so that we can try them out in the emulators, because the emulators can't open files from the local file system.

They have to access these web pages through a web server. So here on my boot drive for My Computer, this is C:. I'm using IIS, so I've got an inetpub folder, and again based upon what server you're using, this folder might be different. And in here, I've got a folder named wwwroot. This is the root folder from which all the HTML files are going to be served. And in here, I've created a folder named MobileWebDevFund, which, if we look inside, contains copies of all of the exercise files.

So the way the workflow is going to work is I'm going to modify the local versions of the exercise files in this Desktop folder and then each time I modify it, I am going to copy it from the folder here into the corresponding folder on the local web server, so that we can try them out in the emulators. So let's take a look at how that works. Let's go back to the code. So before we actually fix this file and edit it and try it out in our emulators, let's see what it currently looks like.

So, let's bring it up an Opera. All right, here is Opera Mobile, and we'll just go to http://localhost/MobileWebDevFund/ and the chapter is 03_sittingup/first_mobile_start.html. And you can see that when I bring the page up in Opera, it looks really, really zoomed out.

This is clearly not how we want it to look in the finished version. Let's take a look in Android, and we'll do the same thing. Now remember, on Android we don't simply type localhost. We have to use the special localhost keyword code, which is 10.0.2.2, and we're going to go to MobileWebDevFund/03_settingup and it's first_mobile_start.html, and you so we'll go out.

And you can see same result here. The page looks very zoomed out. It's not laid out ideally for the mobile browser. Let's try Windows Phone. Okay, same thing here. Let's do localhost and same story. Okay, so now you can see that these pages are pretty zoomed out, and they are not laid out ideally for the mobile browser's page width. Let's go fix that. So let's go back to the code. So over in the snippets file, I am going to copy these three lines-- 1, 2, 3, copy--and we are going to go back to the code over here and paste them into the head section.

So these three meta tags we'll paste in and we'll save. So what these three meta tags do and we'll learn more about them as we go thorough the course, these three meta tags are the first step in telling the mobile browser that the web page that it has loaded has actually already been laid out for the screen width of the mobile device, so that the mobile browser should not display the page as if it were a desktop page in the fully zoomed-out fashion. It's saying, "Hey, this is a web page that's actually the same width as one of your screen is.

You don't have to worry about trying to zoom it out or do any kinds of layout optimizations to the page." So let's save. Now let's go back out to the file system. I'm going to go into my folder here, and this is the file right there, first_mobile_start,and this is the folder where it's going to go to. So I am just going to copy this over here. I'll just copy and yes, go ahead and replace it. So now I've replaced the file in wwwroot/MobileWebDevFund/03_settingup. So let's go back to the browsers and see how it works.

Let's start off with Opera. So here it is. Now I'll refresh, and you can see now that the page is zoomed in properly. This is an h1 tag here with a paragraph that's much more readable. Let's try it in the Android browser. Okay, so let's go ahead and just refresh this, and you can see same results. Now the page looks much better. And finally, on Windows Phone, let's just refresh this page by pressing the Refresh button, and much better. So using those three meta tags, we were able to take an existing HTML page and make it lay out much better in mobile web browsers, and we'll learn more about that as we go through the course, but for now that's it.

We've built our first mobile web page.

Show transcript

This video is part of

Image for Mobile Web Design & Development Fundamentals
Mobile Web Design & Development Fundamentals

46 video lessons · 24401 viewers

Joe Marini
Author

 
Expand all | Collapse all
  1. 2m 48s
    1. Welcome
      1m 2s
    2. Using the exercise files
      1m 46s
  2. 29m 25s
    1. Understanding the mobile context
      8m 5s
    2. A survey of mobile sites
      11m 44s
    3. Targeting mobile browsers
      4m 31s
    4. Previewing a complete mobile site
      5m 5s
  3. 27m 20s
    1. Designing for one web
      3m 43s
    2. Using well-defined web standards
      3m 45s
    3. Designing mobile-friendly pages
      3m 40s
    4. Being crisp, clean, and succinct
      5m 45s
    5. Minimizing input where possible
      6m 47s
    6. Focusing on the core scenarios
      3m 40s
  4. 1h 13m
    1. Installing the tools
      3m 52s
    2. Setting up a local web server
      9m 13s
    3. Installing device emulators
      17m 5s
    4. Using device emulators
      13m 9s
    5. Downloading Modernizr and Mobile Boilerplate
      6m 22s
    6. Building a first mobile web page
      5m 43s
    7. Developing mobile pages with desktop browsers
      8m 6s
    8. Exploring useful mobile web development resources
      10m 23s
  5. 53m 26s
    1. Reviewing mobile markup languages
      5m 10s
    2. Understanding content adaptation approaches
      10m 32s
    3. Controlling the viewport layout
      12m 50s
    4. Designing forms
      13m 30s
    5. Using CSS media queries
      11m 24s
  6. 1h 11m
    1. Detecting client capabilities with script
      10m 8s
    2. Caching information with local storage
      9m 16s
    3. Determining position with geolocation
      12m 52s
    4. Minimizing HTTP requests with data URLs
      7m 39s
    5. Understanding user agent detection
      9m 8s
    6. Using server-side detection with PHP
      6m 52s
    7. Using server-side detection with ASP.NET
      4m 54s
    8. Using HTML5 Boilerplate for mobile
      11m 6s
  7. 39m 22s
    1. Measuring performance
      7m 41s
    2. Creating full-screen web apps
      6m 30s
    3. Customizing the user interface
      5m 14s
    4. Detecting orientation changes
      3m 58s
    5. Detecting device movement
      5m 21s
    6. Using touch events
      10m 38s
  8. 47m 14s
    1. Taking a look at the finished site
      7m 40s
    2. Examining the header and background image style on the Home page
      10m 10s
    3. Examining the hover effect and layout styles on the Tours page
      6m 42s
    4. Examining mobile forms on the Contact page
      9m 45s
    5. Viewing and testing the mobile site on emulators
      8m 11s
    6. Viewing the site on devices
      4m 46s
  9. 2m 34s
    1. Goodbye
      2m 34s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Mobile Web Design & Development Fundamentals.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.