Unit 4.02 Flash Cards
Terms in this set (44)
Most websites have organized their content in multiple columns (formatted like a newspaper or magazine).
Multiple columns are created by using <div> or <table> elements. Cascading Style Sheets are used to position elements, or to create backgrounds or a colorful look for pages.
Layouts that work on many devices
<div> layouts and CSS can create flexible layouts that work on various screen sizes. Responsive web design is a web design approach aimed at crafting sites to provide an optimal viewing experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices.
Devices vary in resolution and pixel density
As hardware changes, resolution and pixel density change.
Web layout needs to be flexible and adjust to various mobile devices and new devices. A pixel is an abstract unit of measurement and it does not have a single specific size.
The smallest physical unit in a display.
Reference pixels are based on an optical reference unit and developed by the w3c.
CSS pixel is a unit of measure.
The smallest unit of data in a raster image.
The <div> tag defines a division or a section in an HTML
document. The <div> tag is used to group block-elements to format them with CSS. The <div> element is very often used together with CSS, to layout a web page.
The Power of <div>
Web developers use <div> elements to group together HTML elements and apply CSS styles to many elements at once.
<div> tag and attributes
The <div> tag supports the global attributes in HTML. HTML 5 has introduced some new global attributes.Global attributes be used on any HTML element.
Some examples of global attributes
id - Specifies a unique id for an element.
class - Specifies one or more class names for an element (refers to a class in a style sheet).
style - Specifies an inline CSS style for an element.
lang - Specifies the language of the element's content.
<header> <footer> <nav> are new in html5
A fairly standard layout consists of a banner near the top, navigation, and your content or display box. These are the backbone to any great website. In HTML5 there is a <header> element, as well as a <nav> <footer> that can replace these div tags.
Many of existing web sites today contains HTML code like this: <div id="nav">, <div>class="header">, or <div id="footer">, to indicate navigation links, header, and footer. HTML5 offers new semantic elements to clearly define different parts of a web page; such as <header>.
Why use Fixed Layout
A fixed website layout has a wrapper that is a fixed width, and the components inside it have either percentage widths or fixed widths. The important thing is that the container (wrapper) element is set to not move. No matter what screen resolution the visitor has, he or she will see the same width as other visitors.
From Fixed to Fluid
Compute Percentages and change from pixels to percents.
From Fixed Layout to Fluid
The concept of fixed layout to fluid means we want to calculate an equivalent percentage to use inside the wrapper div. In our example, we divide 880 ÷ 960 = 0.91666667. Which we will round to 92. The content and sidebar areas are within the 880-pixel-wide wrapper div, we need to find the percentages of these relative to this div so: 640 pixels ÷ 880 pixels = 0.727272 → 73% 220 pixels ÷ 880 pixels = 0.25 → 25%
Why consider Fluid Layout
In a fluid website layout, also referred to as a liquid layout, the majority of the components have percentage widths, and thus adjust to the user's screen resolution.
Relative layouts are accomplished by using a relative unit like the em or the percent ("%"). The em is basically the height of the font being used on the page. It is considered relative because a 16 point font has a different height from, say, a 12 point font. The percent has the normal meaning you are used to from mathematics. That is, if the width of the page is set to 80%, it means 80% of the maximum width it can have. It's regarded as relative since the maximum width varies depending on how big your browser window is. The term "em" is a reference to the Letter "M" in written form.
The "em" is a scalable unit that is used in web document media. An em is equal to the current font-size, for instance, if the font-size of the document is 12pt, 1em is equal to 12pt. Ems are scalable in nature, so 2em would equal 24pt, .5em would equal 6pt, etc. Ems are becoming increasingly popular in web documents due to scalability and their mobile-device-friendly nature.
Factors to consider in Layout
Screen resolution and pixel density. Browser choice. Whether or not the browser is maximized. Extra toolbars open in the browser (History, Bookmarks, etc.). The operating system and hardware.
What is SVG?
SVG stands for Scalable Vector Graphics. SVG is used to define vector-based graphics for the Web. SVG defines the graphics in XML format. SVG graphics do NOT lose any quality if they are zoomed or resized. Every element and every attribute in SVG files can be animated. SVG is a W3C recommendation.
WHEN USING BITMAPS
For modern browsers, add "max-width: 100%" to images so they scale down to fit within their containing element in a fluid layout. Bitmap images are composed of a fixed set of dots, while vector images are composed of a fixed set of shapes. Scaling a bitmap reveals the dots while scaling a vector image preserves the shapes.
WHY SCALABLE IMAGES?
Regardless of the method used, raster images remain inherently constrained by their bitmap resolution; they were never meant to be infinitely scalable. This is where vector graphics have the advantage, being a future-proof way to "Retinize" your Web graphics. A single SVG image can be used as a universal asset, scaling infinitely up or down as required. This not only saves precious bandwidth (most SVG files tend to be smaller in size than standard-resolution PNGs), but also makes your graphic assets much easier to maintain.
ADVANTAGES OF USING SVG OVER OTHER IMAGE FORMATS (LIKE JPEG AND GIF)
SVG images can be created and edited with any text editor. SVG images can be searched, indexed, scripted, and compressed. SVG images are scalable. SVG images can be printed with high quality at any resolution. SVG images are zoomable (and the image can be zoomed without degradation).
WHAT DO YOU SEE ONLINE?
Most images on the Web are bitmaps; also known as raster
graphics. Bitmaps can be pre-scaled or resized so an appropriate size is displayed depending upon the viewport.
GUIDELINES FOR IMAGES
Avoid using images with inappropriate resolutions. Pre-scale images in various resolutions and serve an image appropriate for the viewport. When images are not scaled appropriately, they will appear blurry when scaled up. Images that are larger than necessary waste battery and cause longer downloads.
A mobile browser, also called a microbrowser, minibrowser, or wireless internet browser (WIB), is a web browser designed for use on a mobile device such as a mobile phone or PDA. Mobile browsers are optimized so as to display Web content most effectively for small screens on portable devices. Mobile browser software must be small and efficient to accommodate the low memory capacity and low- bandwidth of wireless handheld devices.
• Not all browsers render all web content in exactly the same way.
• Web content doesn't need to look exactly the same across every browser and device.
• As long as it still provides a good user experience and gives them access to the content and services required by their current browsing experience.
Web browser rendering
• Your Web browser uses a rendering engine
• The rendering engine will start getting the contents of the requested document from the networking layer.
• For better user experience, the rendering engine will try to display contents on the screen as soon as possible.
Why don't Web pages look the
same on all Browsers?
• The screen resolution of the monitor or screen
• The operating system
• The web browser
• Individual user preferences
Web Browser Output
Web browsers do not render pages pixel by pixel. They read
the entire code and produce an output depending on your code. There are, however, differences in the code interpretation. Therefore you should check the way your website looks on different browsers and operating systems.
What is a Viewport?
• The viewport is the area a web browser has to display a web page.
• The size of that area determines the layout of the page (for example how text flows from line to line)
• On desktop browsers the viewport can be resized by dragging the browser window into any size desired. On mobile devices it is controlled using the viewport meta tag.
• Different mobile browsers have slightly different implementations of the viewport meta tag.
• The viewport meta tag is an HTML meta tag that lives inside the <head> element of a web page. It was originally created by Apple when they released Mobile Safari for the iPhone and though not an official standard it has since been adopted by many other mobile browsers
Zooming & Browsers
Zooming is a common action when users find a website too small for comfortable viewing. Or, to put it another way, websites that are designed too small are very common. There is really no "perfect" size, because almost everyone has at least some level of visual impairment, since our eyes inevitably deteriorate with age.
A word about Zooming
With the increase in touchscreen devices, pinch-to-zoom has become the standard way to enlarge fixed- sized content designed for larger screens (i.e. much of the Web today).
Why responsive design is needed?
• Mobile browsing is expected to overtake desktop browsing within a few years.
• Websites are viewed on a variety of devices beyond traditional desktops--from smartphones to tablets to game consoles to large-screen televisions to vehicles.
• Many of these devices use touch interfaces, game console buttons—things beyond the traditional mouse pointer.
• These devices come in a wide variety of screen resolutions and screen sizes.
• The size of a pixel varies according to the device.
• Mobile networks can be slower and most users have fixed data plans (expense)
• Limited memory, processor power and battery
• A wide variety of browsers are used on mobile devices.
Why are mobile devices popular?
• Always connected
• Personal and can be personalized
• Location awareness
• One-handed device
• Can be used as a universal alerting device
• A device pixel (or physical pixel) is the tiniest physical unit in a display.
• Screen density or pixel density refers to the number of device pixels on a physical surface. It is often measured in pixels per inch (PPI).
• Resolution is a simple count of the number of pixels across the entire width and height of a device.
• The iPhone 5 resolution is 1136 x 640. Compare that to the original iPhone which is 480 x 320.
• Pixel density is a good indication of how clear the device display will be.
• The higher the number, the smaller the size of the pixels, so graphics are perceived as more crisp and less pixelated.
Viewing distance matters
• While pixel density is an important measure, it is not the only factor in the "crispness" of a display.
• Viewing distance can affect the perceived pixel size. A cell phone and a large-screen could have the same pixel density, but the large-screen will appear as more crisp because it is viewed from a longer distance.
Images on the Web
• Besides its raster resolution, an image on the Web has an abstract size, defined in CSS pixels. The browser squeezes or stretches the image based on its CSS height or width during the rendering process.