Web and Mobile Communications

Background Images

If you’d like to add a background image to any element on your page, you do so via the CSS:

header {
background: url('dog.jpg');
}

This assumes,  in this case, that ‘dog.jpg’ is in the same folder as your HTML page.

Background images tile, by default, meaning the repeat infinitely both horizontally and vertically. You can stop or adjust this via CSS:

background-repeat: repeat-x; /*only repeat horizontally */
background-repeat: repeat-y; /*only repeat vertically*/
background-repeat: no-repeat; /*do not repeat */
Posted in Uncategorized | Comments Off on Background Images

Margin, padding and the Box Model

We’ll talk a lot today about margins and padding, which are, respectively, just ‘margins’ and ‘internal margins.’ That’s the easy part!

We can specify where borders, margins and padding go by explicitly declaring where they go: instead of ‘border: 1px solid black,’ we now know we can do ‘border-bottom: 1px solid black.’ Well, you can also do ‘border-top,’ ‘border-left,’ and ‘border-right.’

The same logic goes for margins and padding: ‘margin-left,’ padding-bottom’ – these are all valid.

This being computer code, there is also (of course) a shorthand way of declaring multiple values:

padding: 30px;

This will add 30px of padding to the top, bottom, left, and right. 

margin: 20px 40px;
This will add 20px margins to the top and bottom, and then 40px margins to the left and right.

padding: 10px 0 20px 30px;

This would make the top have 10px padding, the right have none, the bottom have 20px padding, and the left have 30px padding. So Top, Right, Bottom, Left, or TRBL (trouble). 

The collective properties of margin, padding, border and width combine to make up the box model.

We’ll also be talking about Block Vs. Inline elements. Every HTML element is either set to block or inline automatically; you can alter that setting via CSS. More on the difference between Block and Inline here:

http://www.impressivewebs.com/difference-block-inline-css/

Posted in Uncategorized | Comments Off on Margin, padding and the Box Model

Colors

Some Color Combination sites:

The (legitimate) Adobe one: https://color.adobe.com/create/color-wheel/

The (less legit) one: http://www.colorcombos.com/

Posted in Uncategorized | Comments Off on Colors

How to Fix your Code

A Checklist.

Basics

  • Have you saved both files?
  • Have you refreshed the browser?

Now, the harder stuff: 

  • Are your files in the exact same directory on your hard drive? Are you sure?
  • Are you actually viewing those files in Brackets, or is it perhaps a file with the same name located elsewhere? Are either of your documents actually on a server?
  • Have you made multiple copies of this project, and if so, are you sure you’re working on the right version?

Now, the HTML stuff:

  • Is your HTML to link to the stylesheet inside the <head>? Does it look like this:
<link rel=“stylesheet” type=“text/css” href=“stylesheet.css”>
  • Where the code indicates the name of your stylesheet, are you certain that’s the exact name? Are there any capital letters or spaces?
  • When you look at that line of code, does it appear to be color-coded correctly by Brackets? Are there any unclosed tags or typos above the line of code not working? 
  • Do you have any duplicates of code that are only meant to appear once? What about duplicate closing tags, or none at all? 
  • Are you certain that the names of the tags you used in your HTML document align with the ones you used in your CSS document?

Now, the CSS stuff:

  • Is there anything in your CSS file that isn’t CSS? Like having a <style> HTML tag at the top of the document? That’d zap the whole doc. 
  • If you have a major error anywhere in your CSS, it’ll zap all the code below it. In ideal circumstances, you will notice the color coding changes and seems odd at some point in your document – look just above that. The most common errors are forgotten {curly brackets} and semi-colons; look for those.
Posted in Uncategorized | Comments Off on How to Fix your Code

Definitions for the Web

First of all, let’s remember what we’ve learned regarding Web programming:

  • Code can be broken into three general areas: Markup (HTML/CSS), Scripting languages (JavaScript), and Programming Languages (Perl, Java, C++, etc.)
  • HTML is used for structure, CSS is used primarily for style. JavaScript is used to add interactivity.
  • HTML used ‘tags,’ which are wrapped in ‘carats’ (the greater-than / less-than symbols). The also have parameters (also known as attributes) which can modify them (like setting a link’s URL, or defining an image’s source file).
  • Content is created locally, i.e. on the Desktop, which (obviously) cannot be seen by the world on the Internet. An FTP program is the conduit for transferring your local files to a server so everyone can see it online.

Regarding servers, domains, and the like:

  • The Internet is not centralized, but rather a ‘network of networks,’ and is not owned by anyone or any government (nor can it be).
  • The ‘world wide web’ is a subset of the Internet, and the primary way most of us interact with it. It uses http requests to show html content. But it’s not the only way information is transferred over the Internet (FTP is another example).
  • A URL is the ‘English’ way of describing a Web address: ‘amazon.com,’ ‘elon.edu’ – but Web addresses are really just collections of numbers, known as IP addresses: ‘205.251.242.54 (Amazon’s IP address),  ‘152.33.2.72‘ (Elon’s IP Address).
  • A Domain Name Server (DNS Server) is the name of the application that pairs URLs with IP addresses, so we don’t have to memorize strings of numbers in order to visit our favorite Websites.

And finally, regarding Website content:

  • A site that requires developer input to be changed is a ‘static’ site. The ‘bio’ page you made before is a static site – the contents and appearance of this page will not change unless you manually change it.
  • Contrast that with a dynamic site, whose content can be updated by user input, search / purchase history (like Amazon), or new blog posts. Dynamic sites use databases to alter their content.
  • A Website that is ‘responsive’ changes its layout and appearance based on your screen resolution. The new Elon website is a good example: open it up, adjust the width of the browser window, and see how the content and layout change.

 

 

Posted in Uncategorized | Comments Off on Definitions for the Web

Connecting to Quicksilver using a PC

To connect to the Quicksilver server in the Microsoft Windows environment, do the following:

  • Find the ‘Computer’ or ‘My Computer’ icon on your desktop, and double-click it.
  • In the ‘Tools’ drop-down menu, choose ‘Map Networked Drive…’
  • In the blank text field, enter ‘\\quicksilver\walsh’ (or ‘\\quicksilver\server, where ‘server’ is the name of the quicksilver server you’re trying to connect to)
  • If/when a login pops up, enter the login info for the server (for the walsh server, both fields are ‘walsh’)
  • A window should open with the contents of the server.

 

Posted in Uncategorized | Comments Off on Connecting to Quicksilver using a PC

What are my FTP settings?

Good news: your FTP settings are so easy, you can write them down once, and be good to go. You can also create a bookmark in Cyberduck so you never have to type them in again!

All FTP programs require three bits of information to work: the host (or server, same thing), username, and password.

For all FTP programs, these settings will work for every Elon student:

Host/Server: student.elon.edu

(please note: there is no ‘http,’ no ‘www,’ no ‘/yourusername,’ just ‘student.elon.edu,’ for everyone, no matter what.)

Username: Your Elon username (what you use for your Elon email)

Password: Your Elon password.

All FTP programs can also vary the level of security used with FTP. For our server (student.elon .edu), it is required that we use SFTP, or ‘secure’ FTP. If you leave your FTP program set to ‘standard’ FTP, it won’t work with our server.

So, try this: open up Cyberduck, click the ‘new connection’ button, and make sure the connection type is set to ‘SFTP’ (it’s right at the top of the window). Then type those three bits of information in: host/server, username, password, and hit ‘Connect.’

Posted in Uncategorized | Comments Off on What are my FTP settings?

The basic building blocks of HTML

HTML is written in a kind of broken English – more similar to teenage texting grammar than anything else, I’d say – which make it much easier to learn and understand.

‘img’ = ‘image.’ That’s somewhat straightforward. Here’s a few other examples:

‘h1’ = ‘headline text: largest size’

‘h2’ = ‘headline text – second-largest size’

‘p’ = ‘paragraph’

Of course, there are exceptions to this. One common tag whose syntax does not clearly reflect its function is the HTML tag to create a link:

‘a’ = ‘create a link.’

Well, why ‘a?’ Why not ‘link? (short answer: ‘link’ was already taken). In this case, ‘a’ is short for the word ‘anchor.’ Have you ever visited a website that had links at the top of the page, and when you clicked them, the link scrolled you down that same page? Well, that is an ‘anchor.’ To put that another way, anchors can be used to create links on the same page you’re linking from.

If that didn’t make sense, don’t worry – the only thing you need to know is that ‘a’ = ‘link.’

 Punctuation

The syntax of HTML uses a lot of punctuation: every tag uses ‘<‘ and ‘>’ and there’s a lot of equals signs and quotes. Well, the good thing is that this syntax is standardized, meaning it’ll never vary in HTML, so you can memorize it:

<tag parameter=”value”> </tag>

Remember, all the HTML mentioned above are ‘tags,’ or pre-written HTML. A ‘parameter’ is a property of a tag that can be modified (example: width=”300px,” where the parameter is ‘width,’ and the value is ‘300px.’).

Also, that slash in the above example indicates that a tag is closing – remember, we’re writing instructions to a browser, so unlike giving instructions to a human being, you have to always clearly indicate when to stop things. So in this ‘real’ example:

<h1>This is a headline</h1>

…if that trailing ‘</h1> tag wasn’t there, our entire page after this point would be a headline (bold, large font size, space above and below).

Structure

All HTML documents are assembled like humans: a <head> on top, filled with information you cannot see, and a <body> underneath it, which you can see. So for this class, you can largely ignore the content in the <head>, and just make sure all of the code you write is inside the <body>.

Posted in Uncategorized | Comments Off on The basic building blocks of HTML

Lynda.com access

As an Elon student you have access to Lynda.com tutorial and training videos. All you have to do is search for “Lynda” on Elon’s homepage or go here and click the big yellow login button. You may be asked to enter your Elon username and password and then you’ll be redirected to Lynda.com.

The Web Technology Fundamentals videos that Professor Walsh and I referenced are located here, but you must be logged into Lynda.com (see paragraph above) to be able to watch the videos.

Posted in Uncategorized | Comments Off on Lynda.com access

How To FTP to your student server

We’ve created a YouTube screencast video that walks you through the basics of how to connect to your student server, as well as how to edit its contents. I’ve also attached a document to this post that describes the process in a shorter, more straightforward way.

Please Note that in order to get this to work, your FTP program (Cyberduck, in this case) must be set to use ‘SFTP’ as its default protocol. The ‘S’ is for ‘secure.’

To change Cyberduck’s settings to use SFTP instead of ‘standard FTP,’ do the following:

  • Open the Cyberduck application.
  • Open the preferences by going to the ‘Cyberduck’ drop-down menu, and choosing ‘Preferences…’
  • Under the ‘General’ tab, look for the ‘default protocol’ setting, probably in the bottom-right of the window
  • Change the default protocol to ‘SFTP,’ and close the preferences window.

Instructions for Student Use of the Elon Web Server (Microsoft Word document)

Posted in Uncategorized | Comments Off on How To FTP to your student server