CreateaFreeWebsite  with Responsive Web Design

General

 

9 Step Tutor

Linked Style Sheets

Linked style sheets are placed in a separate text file and saved in the root directory.

The file is saved with a css extension.

The link to the file is placed in the head section of each document.

Linked style sheets contribute to the creation of consistency throughout your web pages.

Code in Head Section:

<head>
<link rel="stylesheet" href="mystyle.css" type="text/css">
</head>

Example of lines in mystyle.css text file:

body {
max-width: 1200px;
margin: 0 auto;
font-family: Arial, sans-serif ;
font-size : 18px ;
color: #000000
}

p { 
text-indent : 16px;
text-align: left}

h1 {
font-size : 22px;
text-align :center
 }


strong{ 
	font-weight : 700;
 color: #876541
}

p.red{ font-weight : 600; color : #ff0000}

#reddiv {
width: 100%;
background: #ff3300
}

Adding Media Queries for Responsive Design

One of the greatest tools added to the CSS3 arsenal is the Media Query

Placed at various places in the linked style sheet at what are called breakpoints, they allow the author to change font sizes, resize or swap out images, change the size, margins and padding of container elements like headers, nav elements divisions , footers and more.

You can even hide things and make things appear at opportune times using the CSS property display.

To make the best use of breakpoints and Media Queries, study the devices used to visit websites today. Over 50% of site visitors these days are using cell phones with screen widths from 344 pixels to about 414 pixels.

A strategic breakpoint could be placed in the linked style sheet at 450 pixels using the following code which would adjust the page at 450 pixels viewing width.

@media all and (max-width: 450px){
Adjustments Here
}

Another could be placed at 360 pixels

@media all and (max-width: 360px){
Adjustments Here
}

Testing With Developer Tools

You can actually test these width settings using your browser's Developer Tools. Most browsers have them and most carry a function that simulates looking at your pages using different sized devices.

First open the web Page in your browser of choice.

You can open Developer tools in most browsers by pressing CTRL Shift j. See: Web Developer Emulator Tool Tutorial.

 

Free Tools and Resources We Recommend

Free Responsive Web Design Certification freeCodeCamp
freeCodeCamp is a proven path to your first software developer job.
More than 40,000 people have gotten developer jobs after completing this – including at big companies like Google and Microsoft.
Finally, you'll learn how to make webpages that respond to different screen sizes by building a Twitter card with Flexbox, and a complex blog layout with CSS Grid.
FREE Certification Courses!!
Free Ebook How to Code in HTML5 and CSS3
"How to Code in HTML5 and CSS3" is a free e-book about making websites in HTML5 and CSS for absolute beginners. It doesn't require any experience in IT to start....
FREE HTML Editor (Windows): NoteTab Light
All the features of a commercial HTML editor.
FREE Apache Server (Windows): IndigoAmpp
Set up a real time server environment right on your PC. Test forms and scripts before uploading to your web space.
Linux Users
If like us, you've left the insane world of Microsoft Windows for the even worse experience of Linux, we recommend the BlueFish HTML editor. You'll find it in your software repository. It does have some QUIRKS, but it's FREE.
For image resizing we've found the easiest Linux tool to be Krita.

Have you tried our FREE RWD template kit? Download Template #402 - 6 Page Kit