Step By Step

Responsive Design

Small Size Screen

maximum width = 640 pixels

Day 5

Assignment 9:css information for small screen media query


Since we are designing this application with the mobile first approach, we need to key in the code telling the browser to format the data listed below the media query, only if the screen view port or browser window is 640 pixels or less. The query we are using is for 640 pixels maximum screen width which covers a number of cell phones in the landscape mode. The line appears below. Max-width means no more than and min-width means no less than. It is best to use the viewport in determining the media query since there so many devices on the market and using device-width would be a daunting task. Today it is difficult to determine the differences between laptops, tablets and phones. You may experiment with these breakpoint numbers if you wish.


@ media only screen and (max-width:640 px{

}



Previous code: laid out in a row.



background-image:
url(piratescove7.jpg);
background-repeat:
no-repeat;
background-size:
cover;




Responsive Design Video

The finished product should look somewhat like the partial image below




Medium Screen Size

minimum width = 641 pixels maximum width = 1024 pixels

Day 6

Assignment 10: css Code for a medium sized screen media query



As we look at a medium size format for our media query,it is a good idea to see what was used for flexbox attributes, headlines, paragraphs and links. The tables that appears below shows the current status for small screens. We will want to change some of these attributes for a medium screen like a tablet. Below are the changes that we will make after we key in the code for a medium screen query.
Text Formatting Attributes: small screen

Element

Size

Font Name

Font Color

Body

20pt

Helvetica

#969696;

h1

bold 60pt

Algerian

white

h2

bold 40pt

Old English Text

white

h3

bold 35pt

Algerian

white

p

15pt

Arial sans-serif

blue



Formatting Links: small screen

Link Type

Font Name

Weight

RGB Color

A:link

tahoma

18pt

(0%,19%,57%);

A:visited

tahoma

18pt

(89%,0%,13%);

A:hover

tahoma

18pt

(0%,0%,0%);

A:active

tahoma

18pt

(100%,75%,0%);


There are a few changes needed to the flexbox attributes to change over to a somewhat larger screen. A larger screen can now accommodate more than one column of text, like our original template. The #main attribute for the layout of the entire page needs to be changed to rows instead of a single column.
#main{
min-height:800px;
margin:0px;
padding:0px;
display: flex;
flex-direction:row;
}

Another change in the flex boxes has to do with the header. We want to put a different picture here. By changing the picture we can see when that screen size is reached when we drag the window. Change the name of the picture file in the header from piratescove3.jpg to ps2.jpg in the medium screen size query.

How to proceed with making the changes for a medium sized screen format.



@media only screen and (min-width : 641px) and (max-width: 1024px){

Your finished project for a medium-sized query,should look like the image below.


Day 7

Assignment 11


Since we have a larger screen we might want to add an additional picture. We might want the picture to appear only when the media query is set for a medium-sized screen. If we put the <img> tag in the html file, our picture will appear in all media queries. To remedy this, we will put the picture inside the css code media query for a medium-sized screen. In the example that follows, we will add a picture of our boutique to the aside section for a medium screen layout. Proceed as follows.

Background Position Options

Horizontal

Vertical

left

top

left

center

left

bottom

right

top

right

center

right

bottom

center

top

center

center

center

bottom


You can also use pixels or percentages to set these parameters. For example, 0px 0px is the top left-hand corner. 25% 75% is: horizontal position 25% and vertical position 75% inside the flexbox.



boutique picture

You can also change the way the flexboxes are displayed on the screen. The Order attribute does this. Currently The <nav> box is displayed first, the <article> box is displayed in the second position and the <aside> is third. In the student.css file, change the order for the medium sized format to display aside flexbox first, the article flexbox second and the nav flexbox third.

Save your student.css file and then run the student.html file to see the changes. Your result appears below.