Please enable JavaScript.
Coggle requires JavaScript to display documents.
Web Dev (Jake Wright) - Coggle Diagram
Web Dev (Jake Wright)
JavaScript
-
-
-
-
Strings
Are stored as objects that have properties, such as the length (tells you something about the object)
-
Also have methods that can be called (can take input, do computation and output an answer)
substring
x.substring(3, 5); returns characters within that range of the string with the parameters
-
-
Flow Control Statements
-
for(i = 0;i<5;i++) { ... } a for loop, initialisation, condition, what to do
-
CSS
-
Define sections for CSS by adding tags to divs, where all content in that div will be effected
-
-
In the CSS file
-
Customisation
-
-
Adjusting position
-
Divs proportions
-
-
Padding between divs
padding: 10px 10px 10px 10px; (top, right, bottom, left)
if all numbers are the same, just use the one number padding: 10px;
To have divs not just appear on a new line by default, they need to float next to each other (floats next to it's parent)
-
If another div overlaps as a result of floating clear: both; should reset the overlapping by making sure it is clear of any floating elements before displaying itself
Customising classes
Instead of using #, add a .class {...}
If that class exists somewhere else and you want to be more specific, you can do #tag. class {...} filters it down to any object with the class inside the object with the id/tag
-
-
To get rid of the physical bullet points in an ul list, do #tag ul { list-style-type: none; }
-
-
Changing the font
font-family: font1, font2, font3;
-
-
-
Can seperate identifiers with spaces i.e #content .sidebar { ... } this'll apply this rule to any object with the class "sidebar" inside the object with the id, "content", but this id could also be any class and the chain can be any length as long as they are all inside of each other from left to right
HTML
-
Tags
-
<html> </html>
All html documents have to have this, everything in the html file goes inbetween these tags
-
<body> </body>
-
<h> </h> (h1, h2, h3, h4, h5, h6)
-
-
<img src="Image Path" /> (width="x" is optional attribute, and would be added after the src, if that property isn't put in, the image is displayed as default size) Adds an image. (Can also use height="x" attribute to adjust height)
A technically required attribute is alt="x" which contains a description of the image, in case the user is using a screenreader or text only browser (won't actually see yourself)
-
<a href="url">text for hyperlink</a> creates a hyperlink to another web page, with the text used fthe hyperlink
Lists
Bullet pointed
<ul> </ul>
Inbteween, indented used <li>Item</li> to insert each point
For numbered lists, instead use <ol> </ol> in place of <ul>
Div tags
-
Always causes an invisible linebreak before and after itself, by default, nothing can appear to the sides of a div, only above and below. But this can be cahnged through CSS
<div> </div> indented inbetween, put contents of the group
-
Best to give it the id="id" attribute, ids must all be unique
To target a group of elements, you can give them all the same class using the class="class" attribute
-
For copyright symbol type, (& copy ; with no spaces)
Span tag
Same as the <div> tag, except it doesn't cuase a line break, so good for wrapping around anything laready inside an element
-
At very beginning explicitly type the doc type. Which tells the browser what version of HTML to expect, must be the first thing in the html file. Even before the <html> tags. Add <!DOCTYPE html>