desktop view

Educator's wall of ideas and tech tutorials

Educator Technology Wall

Posts Tagged ‘HTML’

Intro to Web Design and Development

Posted on: January 22nd, 2013

This post is for the ninth graders at SOF. Next semester, we’ll start a new unit on Web Design and Development and you will have the opportunity to code for the web and build webpages and web apps using HTML ( HyperText Markup Language), CSS (Cascading Style Sheets) and JavaScript. This is the holy trinity of the web that’s used for building any website nowadays.

You will not use special software nor manipulate programs that does the work for you; you will create clean and consistent lines of code from scratch using open source programs. The code is free and available for you to play with.

That’s what many today’s tech giants did in their middle and early high-school years, play with the code in its various forms. For example, Mark Zuckerberg began writing software in his middle-school years in NY and his father would hire a guy to tutor him programming privately! Others like Steve Jobs and Bill Gates were very attracted to electronics and programing since an early age and at the age of 13, Bill Gates is reported to have been excused from Math classes to pursue his interest in learning and developing games using programming languages like BASIC.

HTML and CSS are not core programming languages but provide a nice foundation and easier intro into programming with JavaScript or any other programming language. HTML is responsible for the structure of the website while CSS helps with the presentation and the look of it. You can’t do one without the other, it’s like each represents the other half of a whole.

Respond to this post with comments and suggest topics that we can use with our code when building webpages. When we build the code we’ll also need to have interesting content so I’ll start with some ideas that cross my mind right this moment: building a social networking profile, building a personal webpage, creating an auto dealership of your favorite car, building web forms, login text fields, etc. Fell free to add yours below.

Recommended DOCTYPES for websites

Posted on: September 18th, 2012

When you author an HTML document, it is essential that you add a Doctype declaration or better said, the proper Doctype declaration. The latest doctype for HTML 5 is available for us to use now but if you use an old computer with old browsers it might not work properly. This is exactly what happened to some of my students in the school’s computer lab the other day. Alternatively, here are some other Doctype declarations recommended by W3C, the institution that develops protocols and standards for the web.

So, here are some common doctypes below. Choose one to put at the top of your webpage, just copy and paste it.

For HTML 4.01.

Strict

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

Transitional

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

For XHTML 1.0

Strict

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Transitional

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

HTML 5

<!DOCTYPE HTML>

Design vs. code. How Not to Get Started in Web Design

Posted on: September 3rd, 2012

If you’ve been seriously thinking about creating websites but are not sure where to start, then keep on reading. In this post I will share some ideas you should consider when picking a text editor for learning HTML, CSS and JavaScript. There are many paid and free resources available to you on the web. For example there is lynda.com, an online learning library with lots of tutorials for aspiring and seasoned web designers.

If you prefer to go to a face-to-face training, you can head to Noble Desktop in SoHo, their newly-redesigned website is http://nobledesktop.com. Or, if you want to use a book, there are some good books out there such as ‘Head First HTML with CSS & XHTML’ from o’Reilly but there are some others.

Regardless of where you start, you will first need to get your hands ‘dirty’ learning HTML and CSS using a text editor. And here’s my take on how not to dive into your new experience. Do not learn those technologies using a graphic text editor or a WYSIWYG (What You See Is What You Get) type of editor.

Many reputable places, including the first two mentioned in this post, offer plenty of resources on learning HTML and CSS using the graphic interface of Adobe Dreamweaver. They don’t specifically advise you to start your learning this way but they offer plenty of courses that rely on using the graphic interface of an editor and, hey, you are new and probably see no problem in following this path.

Don’t get fooled, while it might be even a little easier to use such a program you actually allow a third party interface in the process. That graphic text editor may provide you some help when designing but, hey, ONlY if you use this specific program. And would you want to master HTML and CSS but only if you use that program?

It is much better if you start learning the code using a simple text editor and once you get down on it, you can choose any text editor you like. When you learn how to code it doesn’t really matter which coding editor you use because they all have in common the same interface with similar features.

I believe everyone who attempts to leave a mark on the web should code because this is the only way to have 100% degree of control of your work. The era of designing with the visual interface editors such as:Dreamweaver or FrontPage is long gone.

Examples of text editors are: Notepad, NotePad++, for Windows, TextEdit, BBEdit, Textmate, Coda for Mac, Aptana Studio for both platforms, etc.

Flexible classic three-column layout

Posted on: October 4th, 2011

Achieving a three column layout

In this tutorial we will create a three-column layout that is responsive to the browser window. We will set a minimum layout width of 800px so that the scrollbars appear if it’s less than 800px. We can test this by simply resizing the browser window. I call this a classic layout because of the way is built.

We’ll start with an container and then inside of it we’ll add the header, content wrapper, content, two sidebars and a footer. In order to be able to build this layout you need an intermediate knowledge of HTML and, especially, CSS.

View the demo

For this tutorial we can use, of course, any text editor and my editor of choice is Dreamweaver. There are two ways you can work in Dreamweaver: using the design or the code view. I prefer using the code view but this tutorial can be easily accomplished using the graphic interface, too.

We begin with the CSS rules and will end adding the HTML divs. Each block of code will be explained first. So, let’s get started. Open Dreamweaver in the code view and in the head section add your styles. Start with <style type=”text/css”>

Here we start adding a universal css reset that is aimed at reducing different browser inconsistencies such as default line heights, margins and font sizes of headings, etc. For a more detailed explanation of this tool read Eric Meyer’s explanation.

    1. * {
      vertical-align: baseline;
      font-weight: inherit;
      font-family: inherit;
      font-style: inherit;
      font-size: 100%;
      border: 0 none;
      outline: 0;
      padding: 0;
      margin: 0;
      }

The largest container has an id of outerWrapper and it will contain all of the other divs in our layout. Setting the margin right and left will center the layout and the min-width property assigns a minimum width of 800px to it. Whenever the browser window is less, the scrollbars will appear. Also the div has an assigned color so we can visually see it.

    1. #outerWrapper {
      width: 80%;
      margin-top: 0px;
      margin-right: auto;
      margin-bottom: 0px;
      margin-left: auto;
      min-width: 800px;
      background-color:#C30;
      }

Now, we are going to create a div with the id of contentWrapper. This div is inside the outerWrapper and will contain all the content of the website except the header and footer. The overflow:auto property will clear the floats that we have for our columns.

    1. #contentWrapper {
      width: 100%;
      overflow: auto;
      background-color:#FF0;
      }

Next is the header, which occupies the entire space across, regardless of how wide is the browser window. Again the color is assigned just for visual purposes.

    1. #header {
      width: 100%;
      background-color:#666;
      }

After the header we move on to creating the sidebars. This is the main sidebar that will appear on the left. I am not a fan of naming sidebars left or right because over time the content of them might be switched and it’s semantically better to name them, let’s say, main and secondary. So here’s the sidebar with the id of sidebarMain that is floated to the left with a variable width of 30%.

    1. #sidebarMain {
      float: left;
      width: 30%;
      background-color:#0C9;
      }

Now we set up the secondary sidebar on the right.

    1. #sidebarSecondary {
      float: right;
      width: 20%;
      background-color:#0C9;
      }

Now we add the div with the id of content right in the middle.

    1. #content {
      float: left;
      width: 50%;
      background-color:#09F;
      }

The last div is the footer which is inside the outerWrapper but outside the contentWrapper.

    1. #footer {
      width: 100%;
      background-color:#630;
      }

Now close your style and head tags.

    1. </style>

 

    1. </head>

 

We’re ready to insert the div tags and apply the id’s to them.
First, open the <body> tag

Now add all the divs and apply the id’s to them. You can simply use the code view or go to Insert and then click on Insert div tag. Also I will add some lorem ipsum text to preview the page in a nicer way.

    1. <div id=”outerWrapper”>
    2. <div id=”header”>Content for id “header”</div>
    3. <div id=”contentWrapper”>
    4. <div id=”sidebarMain”>Content for id “sidebarMain”.</div>
    5. <div id=”sidebarSecondary”>Content for id “sidebarSecondary”.</div>
    6. <div id=”content”>Content for id “content”.
      </div>
    7. </div><!– end of #contentWrapper–>
    8. <div id=”footer”>Content for id “footer”</div>
    9. </div><!–end of #outerWrapper–>

Close your body tag as well as your html tag.

  1. </body></html>