Class Blog

Class Blog

In the Web Programming class at Western TC I learned 3 programming languages,HTML,CSS and JavaScript. HTML is the foundation of the page. CSS add formating and creativity to a page. JavaScript adds behavior and interaction to the page.

<h1>Hello</h1>
                

In the code sample above is the h1 element on of the first html we learned in class. h1 elements is the the default biggest text on the page but that can change with CSS. Most html elmeents have a open tag and closing tag. In the case above h1 has both.

h1{
    color: red;
}
                

In the code sample above is the CSS. The code above will make all h1 elmeents in the page the color red. For CSS it is the element or any selector followed by curly brace, spit the curly brace apart and in the case above color followed by colon, and we could use the hex code of the color we want or the name.

if(x < 7){
    alert("X is less that 7")
}
                

In the code sample above is the JavaScript. The code above is a IF statement. if followed by ( the varibale < 7) curly brace followed by what we want if the the statement is true. We could make this more complicated by adding a else statment.That code would run if the x is more than 7. The code below is what that would look like.

if(x < 7){
    alert("X is less that 7")
}eles{
    alert("X is more than 7")
}