Cascading Style Sheet Language CSS3

A Basic Introduction

Cascading Style Sheet language CSS3 is a companion language to HTML5. While HTML controls the content of a webpage, an externally linked CSS file controls how the content is displayed.

CSS3 is the latest version of CSS. It is used in companion with HTML5.

Change Background with Cascading Style Sheet Language CSS3

To change the background color of a <body> tag, for example,  the code is:

body { background: blue; }

 

CSS files are typically saved with a name like “styles.css“.

Connect Cascading Style Sheet Language CSS3 to HTML5

 

In order for stylings to be seen on a page, the CSS file must be meta-linked to the HTML file to apply the stylings. The code to link the file should be placed in inside the <head> tags.


<!DOCTYPE html>
<html lang="en">

<head>

<title>Page Title</title>

<link href="css/styles.css" rel="stylesheet">

</head>

<body>

</body>
</html>

 

The above code example creates a meta-link. The href attribute must point to the correct name and path of the CSS file. It is common practice to keep CSS files in a folder named “css“.

One of the key features of CSS3 is that only one file is needed per web application. Once you link that style sheet to all the desired HTML pages, then all those pages will be changed according to the CSS3 commands.

Change Text Color with Cascading Style Sheet Language CSS3

Another simple command is changing the text color of the body.


body {
background: blue;
color: green;
}

 

Sufficient practice with CSS3 commands will allow any designer take control of how content is displayed.

Python Reserved Words to Know

This post is as a reference for Python reserved words.

Python reserved words have special meaning, and must only be used in regard to their special meaning. They include:

and not as
global assert del
while elif or
else from with
if pass break
import class raise
continue return def
lambda yield except
print exec finally
for try in
is

You must not use these words as variables, because they already have a special command meaning for Python.

Python understands these commands like a trained dog understands “sit”. So again, you must not use Python reserved words as variables.

Program with Python Reserved Words

You can use one of these Python reserved words to write your first Python program.

print 'Hello World!'

 

This, of course, is the classic ‘Hello World!’ program, written in Python.

Computer Hardware Architecture Basics

Before learning how to program computers, take a moment to understand the computer hardware architecture basics.

The Central Processing Unit

The CPU can execute commands extremely fast. The catch is, it has to be told what to do, or it won’t do anything.

The Main Memory

The main memory stores information that the CPU can retrieve extremely fast. Anything stored here will vanish when the computer is turned off.

The Secondary Memory

This stores memory but it is very slow. We need it because it can store memory even without power. Examples of this are a hard drive, USB stick, or disk drives.

The Network

The network can serve as remote secondary memory, because information is stored over the network that you can retrieve.

The Input and Output Devices

This could be a mouse, keyboard, monitor, speaker, joystick, etc. You use these to interact with your computer.

Properly Edit HTML5 – How To

To properly edit HTML5, every page of content should be wrapped with the <html> tag and the <body> tag.

This next bit is kind of tricky, but you should also include a <header> tag between your <html> and <body> tag. Within the header you should put a <title> tag. This contains meta-data about your web page, and is an important part of SEO. The title will not display on your page, but it should display on your browser tab. It is common for <title> and <h1> tags to contain the same text.

Below is a picture from a text editor to show you a properly edited basic page.

basic HTML5

HTML5 Makes Your Page Respond To Different Screen Sizes

Visit some random web pages and play with size of your browser window. Alternatively, view the pages on a desktop and then a smart-phone. Does the page respond to different screen sizes? If it does then you can assume that it was edited in HTML5.

Now take a moment to view the source code of the world’s first web page. You can view the source code and the HTML that was written. Using Google Chrome to view source code you click on ‘Tools’ and select ‘Developer Tools’. Notice that the HTML is a bit different from HTML5. That’s because HTML is a living language that constantly evolves. HTML5 simply represents a point when the W3C decided to mark it as the latest standard for HTML editing.

 

Must Know HTML5 Tags

You should become familiar with must know HTML5 tags that appear on almost every page.

If you want to put an image on your page then you will need to use the <img> tag with a src attribute. The source attribute contains the URL for your image.

For an example you can go to Google Images. Be sure to click on ‘Search Tools’ and ‘Labeled for Reuse’ so you do not violate any copyrights. Search for an image you like, right-click on it, and select ‘Save Image URL’.

Example of HTML5 <img> Tag

Here is an example of how to edit your HTML5 tag to display a standard Google image.

<img src=”https://encrypted-tbn2.gstatic.com/imagesq=tbn:ANd9GcSdW68P3DrocDWRhCvvr_SrKUyffhspfjGUqlHo03NbOlEbBi9w” />

 

Note that the image tag is self-contained. It does not have a separate </img> closing tag.

Example of HTML5 <img> Tag with Size Percentage Attribute

Here is an image of some bananas, with the width adjusted to 50%:

<img src=”https://encrypted-tbn3.gstatic.com/imagesq=tbn:ANd9GcTq9pG5b4c2fo2EIV044MAChiwDCYt4ReShWJg0cqwrQGu7xFlNzA” width=”50%” />

 

Notice that you can use a percentage for adjusting the width. This is a nice feature to give your site a responsive quality.

Example of HTML5 <a> Tag Wrapped Over <img> Tag

You can also make the image a link itself. You can do this if you want to direct a user to another URL by clicking on the image.

The following is an example of how to edit your code so the image of bananas links to an article about bananas.

<a href=”http://healthyeating.sfgate.com/health-benefits-one-banana-day-3316.html”>
++++<img src=”https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTq9pG5b4c2fo2EIV044MAChiwDCYt4ReShWJg0cqwrQGu7xFlNzA” width=”50%” />
</a>

 

As you can see, you simply put the <img> tag inside the <a> tag. Wrapping tags inside tags is a common practice with HTML5 editing, and it can go several layers deep. However, it is not permitted to overlap tags.

For example, the series of tags <p> <h2> </p> </h2> is not allowed. You can probably see by now why overlapping tags does not make sense.

Example of Using HTML5 Smaller Header Tag

You can make a smaller heading as follows:

<h3>This is a smaller heading. Use it where you want a small heading.</h3>

 

Example of HTML5 List Tags

You can also creat a numbered list, or as the tag suggests, an ordered list as follows:

<h4>Top Three Rock Guitar Players</h4>
++++<ol>
++++++++<li>Jimi Hendrix</li>
++++++++<li>Jimmy Page</li>
++++++++<li>Eddie Van Halen</li>
++++</ol>

 

You can also do an un-ordered list that shows bullet points.

<h4>Random Prime Numbers</h4>
++++<ul>
++++++++<li>1973</li>
++++++++<li>677</li>
++++++++<li>3</li>
++++</ul>

 

Lists can add a nice dynamic to your page content. You can practice making lists at this free and interactive HTML Lists Tutorial at W3 Schools.

 

There are no universal rules on how to use indentations, but you should try to edit it so that it’s easy to read. Your eyes will thank you later. Writing clean code could also help you land a job.

 

Create HTML5 Links – How To

The ‘HT’ in HTML stands for Hyper Text. It’s the idea that your document can link to other documents, and vice versa. This is why we create HTML5 links. The following will explain how to create HTML5 links.

The ability to create links was very exciting when it was first introduced because the linking of many documents allowed for information to flow more freely.

To create HTML5 links you will use the <a> tag with an href attribute. Here is an example:

<a href=”www.google.com”>Go to Google.</a>

Notice the href attribute is inside the opening tag.

Watch a 3.5 Minute Video Tutorial to Create HTML5 Links


If you edit multiple <a> tags you will need to put ‘&nbsp;’ between your tags. Why? Because even if you have space in your text editor, your browser will ignore this ‘whitespace’. Inserting ‘&nbsp;’ between tags forces your browser to put a visible space between your links. It stands for non breaking space.

If this post was helpful, then you might enjoy this post about CSS3 link styling.

Simple HTML5 Tags to Start With

Open the text editor of your choice (such as Notepad++ or Sublime), and you can start editing with some simple HTML5 tags.

These examples will use HTML5.

What is HTML5? HTML5 is the latest finalized standard of the HTML markup language that is used to structure content on the World Wide Web. It was standardized on October 28, 2014. You can read more about HTML5 on Wikipedia.

Start with Simple HTML5 Tags


You can create a main heading as follows:

<h1>This is a main heading</h1>

 

Because you used the <h1> tag, your browser will interpret this with large bold text, which is what you might expect for a main heading.

You can practice using simple HTML5 tags for free, and interactively on the W3 Schools HTML5 Tutorial.


Conceptually, you use tags to structure your page, and your browser can default to a format, like the  large bold text you see for a main heading.

A smaller heading could be edited as follows:

<h2>This is a sub-heading</h2>

 

Note that there is an opening and closing tag.

If you wish to change the default formatting that your browser interprets, then you will need to learn CSS3 font styling. CSS is used to style the appearance of a web page.

A paragraph would be created as follows:

<p>This is the text you will see in a paragraph</p>

 

There are many more types of tags you can use. These were examples of marking up text. Note, the ‘ML’ in HTML stands for markup language.

Continue with more HTML5 tags, and learn how to create links with HTML5.

HTML Introduction and World’s First Web Page

HTML stands for Hyper Text Markup Language.

HTML uses angular brackets for the markup tags. These tags tell the computer how to display the content. Content is different from appearance.

CSS is used in tandem with HTML to control the style of the content.

HTML files are commonly saved with .html extension. Sometimes you will see them saved as .htm, but not as often.

The world’s first web page was written in HTML. You can see how straightforward the content is displayed. Everything you see is the default structure used by HTML, i.e., the size of the headings, the blue links. There is no styling to change the appearance, and there is no interactivity to the page. It is strictly HTML.

HTML5 is the latest industry standard for editing in HTML.

Get started fast with HTML, this W3 Schools tutorial is a great resource, with interactive examples.

Get a Free Text Editor

You need a text editor to write HTML.

Here are some popular choices:

If you have Mac you can download TextWrangler.

If you use Windows you can download Notepad++ or the increasingly popular Sublime Text download. Sublime text is also available for Mac or Linux machines.

Do not use word processing software such as Microsoft Word or Google Docs for writing HTML. It causes extra formatting to be put into your code, and you will end up using a text editor to get rid of it. So it’s best to choose from one of the simple text editors described above.

It’s also important to note that while HTML5 is intended to be cross browser compatible, you should still check your pages to see how they will look in other browsers. For example, you might use the popular Chrome, but someone else might use Mozilla. Always check how your page will look in different browsers. Do not expect uniformity.

Knowing how to code well in the latest version of HTML is a web development skill that any good developer should know.

Web Development Basics You Should Know

Web Development Basics 101

A laptop is an example of the client side of computing. The laptop is what the end-user is looking at. A mobile phone or tablet are other examples of client side.

Data centers with stacks of computers, or one high performance desktop could function as a server.

The server host pages that it can send to the client.

These computers are part of an interconnected network of computers, commonly called the internet. The world-wide web, or the web, is the information that sits on the internet. There is a difference, albeit subtle, between the two terms.

A URL is what we type in our browser to find a web page. URL stands for Uniform Resource Locator.

Our browser renders web pages so we get the full effect of seeing the links, headings, colors, images, etc.

View The Source Code

You can also view a page’s source code. This is the plain text that programmers used to edit how the page is rendered in the browser. For example, go to any web page you frequent. If you are using Chrome as your browser, click on developer tools, and then click on view source code. This will open a window with the source code. Becoming comfortable with viewing source code is an important part of web development basics.

A modern web developer should know how to display content on a page, how to make it look good, and how to make it interactive. HTML is the language used to build the structure of its page. CSS is used to style its appearance. Finally, JavaScript is used to make the page interactive.

Why You Should Use HTML5 and CSS3

HTML5 and CSS3 are the most up to date versions of the markup and styling languages. It’s important to use these versions so the web page will function well on all browsers, and on different size mobile devices. A mobile responsive site can help reduce bounce rate as you increase organic traffic.

Web development basics also tell us that since a huge percentage of searches are done on mobile devices, web pages should be responsive to different screen sizes, thus providing a good user experience.

If you are ready to start learning how to code in HTML5 and CSS3, then try the free and interactive tutorials on Codecademy.