Information Technology Reference
In-Depth Information
With the CSS here, we are not going to do anything super fancy. However, we will take
advantage of Android's Webkit 2 rendering engine to use some of the newer CSS3
features that have become popular over the past couple years. Let us start off with
some basic styling resetting and general layout styles and then crawl through our CSS
file section by section. In Listing 2-2, we will comb through the basic HTML elements on
the page and reset their margin and padding, or how they are spaced apart from each
other on the page, as well as reset the size of fonts and the type of font used throughout
the document.
Listing 2-2. Who's That Tweet? CSS File - Part 1
/*** RESET ***/
html, body, header, section, div, p, ul, li, h2 {
margin:0; padding:0;
}
ul, li {
list-style:none;
}
/*** GLOBAL CSS ***/
html, body {
width:100%;
overflow-x:hidden;
}
body {
font-size:14px;
font-family: 'Droid Sans', Arial, Helvetica, sans-serif;
background:#06c;
}
h2 {
font-size:14px;
}
If you have written any CSS in the past, this first bit of styling code should look very
basic and familiar. We start off by resetting the margin and padding of several of the
page elements to zero to guarantee that whatever styles we assign to the page will be
positioned correctly across the vast array of Android-powered devices. This can be
important especially when you keep in mind that Android is a rapidly developing
platform with newer versions being released two times a year or more.
Next thing we are doing is removing any bullets that might be attached to unordered
lists ( ul) and list items ( li) elements and then setting the pages default font and font
size, as well as the applications background color.
Last but now least, we will be utilizing the “Droid Sans” web font. See, over the past
couple years as the web has been evolving, designers and developers alike have been
screaming and begging for a new and easier way to use those gorgeous fonts you see
time and again in print advertisements on their applications and web sites they are
working on. I mean seriously, who wants to stare of Arial or Times New Roman all day
2 Webkit is an open source web browser engine, which means people can make web
browser software using it. Android uses a custom version of it, as does Apple's iOS.
 
Search WWH ::




Custom Search