Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Basic iPhone Styling > Adding the iPhone CSS

Adding the iPhone CSS

There are a number of user interface (UI) conventions that make an iPhone app look like an iPhone app. In the next section, I’ll add the distinctive title bar, lists with rounded corners, finger-friendly links that look like glossy buttons, and so on. Using your text editor, create a file named iphone.css, add the code in Example 2-2, and save the file in the same directory as your HTML document.

Example 2-2. Setting some general site-wide styles on the HTML body element
body {
    background-color: #ddd; /* Background color */
    color: #222;            /* Foreground color used for text */
    font-family: Helvetica; 
    font-size: 14px;
    margin: 0;              /* Amount of negative space around the outside of the body */
    padding: 0;             /* Amount of negative space around the inside of the body */
}

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint