responsive vs. adaptive web design a responsive web design will "fluidly change and respond to...
DESCRIPTION
Centering Elements Relative divs are centered with margins at "auto" –Margin: top right bottom left Absolute divs must combine both positioning and margins –Left: 50%; –Margin: –halfwidth;TRANSCRIPT
![Page 1: Responsive vs. Adaptive Web Design A responsive web design will "fluidly change and respond to fit any screen or device size" An adaptive design will "change](https://reader036.vdocument.in/reader036/viewer/2022082419/5a4d1b577f8b9ab0599a9b89/html5/thumbnails/1.jpg)
Responsive vs. Adaptive Web Design
• A responsive web design will "fluidly change and respond to fit any screen or device size"
• An adaptive design will "change to fit a predetermined set of screen and device sizes"
![Page 2: Responsive vs. Adaptive Web Design A responsive web design will "fluidly change and respond to fit any screen or device size" An adaptive design will "change](https://reader036.vdocument.in/reader036/viewer/2022082419/5a4d1b577f8b9ab0599a9b89/html5/thumbnails/2.jpg)
Responsive Design• Set the boundaries
– Maintains left, right, top, bottom
– Only works with absolute positioned divs
• Use percentages
• Adjust with "calc"*– Can be used anywhere in CSS
– Compatibility can be an issue
![Page 3: Responsive vs. Adaptive Web Design A responsive web design will "fluidly change and respond to fit any screen or device size" An adaptive design will "change](https://reader036.vdocument.in/reader036/viewer/2022082419/5a4d1b577f8b9ab0599a9b89/html5/thumbnails/3.jpg)
Centering Elements• Relative divs are centered with margins
at "auto"– Margin: top right bottom left
• Absolute divs must combine both positioning and margins– Left: 50%;
– Margin: 0 0 0 –halfwidth;
![Page 4: Responsive vs. Adaptive Web Design A responsive web design will "fluidly change and respond to fit any screen or device size" An adaptive design will "change](https://reader036.vdocument.in/reader036/viewer/2022082419/5a4d1b577f8b9ab0599a9b89/html5/thumbnails/4.jpg)
Setting Element Sizes• Define a resizing function
function resizewin() {winw = $(window).innerWidth();winh = $
(window).innerHeight(); // Use this to resize specific elements
var bsize = winw + "px " + winh + "px";$("body").css("background-size", bsize);
}
• Call initially, and whenever the window is resized$(document).ready(function(){
resizewin();$(window).resize(function(e) {resizewin();});
});
![Page 5: Responsive vs. Adaptive Web Design A responsive web design will "fluidly change and respond to fit any screen or device size" An adaptive design will "change](https://reader036.vdocument.in/reader036/viewer/2022082419/5a4d1b577f8b9ab0599a9b89/html5/thumbnails/5.jpg)
Setting Element Sizes• Different media styles
– Sizes: height, width, min-height, max-width– Orientation: landscape, portrait– Aspect-ratio: horizontal/vertical– Resolution: dpi, dpcm, dppx– Color: bits per color component
• Two ways to include in your page:– Link to different CSS files based on device size<link rel="stylesheet" media="(max-width: 800px)" href="example.css" />
– Specify different CSS rules based on device size@media (min-width: 700px) and (orientation: landscape) { ... }