Basics of HTML, CSS, & JS

Basics of HTML, CSS, & JS

Notes taken from:

Text

Headings - 6 levels ranging from the most important to the least, h1-h6, h1 being the largest font and most important heading Paragraphs - Use the ‘p’ tag to create a paragraph, each tag will represent a new line Bold - make your text bold by wrapping it with a ‘b’ tag Italic - make your text italic by wrapping with a ‘i’ tag Superscript & subscript - for characters that need to be raised or lowered (like raising a number to a power or foot notes), use the ‘sup’ tag or ‘sub’ tag:

    4<sup>th</sup>
    CO<sub>2</sub>

Semantic Markup

These text elements do not change how your webpage looks, but gives more information and meaning to the text. This is important for search engines and screen readers. This will help dictate importance of text and description of the type of text.

Introducing CSS

CSS makes your website pretty! Add borders and color, change the size and look of text, add background color, change the shape of images and boxes, ect. It’s helpful to imagine each HTML element is in its own box that can be manipulated with CSS.

External CSS - Use for sites with more than one page. If you have your CSS in a separate file, add a ‘link’ tag into your HTML so that your document can access it. Put it in the ‘head’ tag. There is no closing tag. Inside the ‘link’ tag add the ‘href’ to provide the path, write the ‘type’ which would be ‘text/css’. Add the ‘rel’ to specify the relationship, which would be ‘stylesheet’

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

Internal CSS - Add CSS directly into your HTML with the ‘style’ tag located within your ‘head’ tag. Add an attribute ‘type’ to state that the styles are CSS with value ‘text/css’

It is a good idea to have an external style sheet so that you dont have to repeat code throughout other pages. This will also make the HTML easier to read. Editing the overall look of your website is easier and faster when editing one file rather than many different areas of code

Be sure to test your new site on many different browsers before launching because some may not support your version of CSS

Basic JavaScript Instructions

for single-line comments, write it with two // before the text.

Decisions & Loops

As the user makers their way through your webpage, different interactions may move them down different paths - which can be determined by evaluations, decisions, and loops

Return home