All Members

Example Member

This is an example Hack Harris member page, to showcase things you can do in HTML, CSS, and JavaScript.

##Overview

The structure of a web page is built in HTML (Hypertext Markup Language. The style of a webpage comes from CSS (Cascading Stylesheets).

Pro-tip: Build your webpage in HTML first, then style it in CSS. If you do both at the same time, you will trip yourself up.

##Fun with HTML HTML consists of elements that contain content inside them. An element looks like this: <div> This stuff is inside the div element </div>

The element is opened using < > angle brackets, and closed using </ > angle brackets with a slash after the first bracket.

Some elements:

A good HTML reference can be found here. A great free online course in HTML and CSS can be found here.

##Fun with CSS CSS provides your webpage with style. You should have your CSS in an external file in your member folder - and link it at the bottom of your index.html file as follows:

<link rel="stylesheet" href="me.css">

The syntax for CSS is as follows:

selector {
  property: value;
  property: value;
}

selector is one of your HTML elements, like div or a, without the < >. property is a property like color, which changes the font color. value is something like #AC1F24, which is red.

You can also use classes and IDs as your selectors. These are set in your HTML as follows:

<div class="target">
    <p>Some text</p>
    <p id="this-one">The text I want to change</p>
    <p>Some other text</p>
</div>

And selected as follows:

.target {
  color: #AC1F24;
}
.target p {
    color: #999;
}
#this-one {
    color: blue;
}

This will make all text red, then make any text inside paragraphs gray, then make the text inside the paragraph with the ID of “this-one” blue.

Here are some CSS properties you can change:

You can also set CSS to take effect when you’re doing something to the element by adding to the last selector, e.g.

A good CSS reference can be found here.