Written by agrublev on . Posted in Uncategorized. Leave a Comment
Written by agrublev on . Posted in Uncategorized. Leave a Comment
Written by agrublev on . Posted in Uncategorized. Leave a Comment
Written by agrublev on . Posted in Uncategorized. Leave a Comment
In the following pen, you will need to add the correct class from the pre-defined classes inside the correct elements.
Basically, look at the available classes, for example

This would be the styling that we would want to apply to the header of our website. In the html, the following element appears to be the correct header that needs this styling:

So we would add the class two to it like this:

And our preview will now look like this:

One class may be used many times, and some elements may not need a class at all!
Written by agrublev on . Posted in Uncategorized. Leave a Comment
In this tutorial we’ll build the exact same website from the midterm. It contains the following elements:
The final product should look like this:

You can either create a project from the welcome screen

Or if you’re already inside a project go to File -> New -> Project

Replace where it says “untitled” with your project name

like this

No spaces! Just text characters.
Then click the create button.
We’ll first need our index.html as this is the file our server will always look for to show to the user first (even if you have 100 other pages).
Right click on the little folder with the name you chose for the project, then select New -> HTML File


You should now see an index.html in the left column of your editor

Now we repeat the process to create a stylesheet called style.css (please always use lowercase characters, no spaces, and try to name the files for each website the same! For example, your stylesheet can be named main.css or style.css, but those are really the only names you should use!)



For us to use a stylesheet (as there can be 10 available stylesheets in a big project for each page) we need to link it from the html file using the link tag.
The link tag should go immediately before the closing of the head tag.

It contains two attributes, rel (relationship, it’s a stylesheet) and href (which is the path to the stylesheet file).
If we created a folder called css then the href would be href=”css/style.css” meaning we’re referencing the folder and then the file inside it.
As a sanity check, making sure our stylesheet is now linked we can simply make the body background black. When we preview our html page the background should be black.

And then from within our index.html file we click the browser icon from the top right:


Great, we’re all set here, let’s erase the sanity code from style.css.
To make it easier to look at both our html and css at the same time, you can simply right click on the style.css tab in your editor and choose split vertically

Then close the tab on the left side that says style.css leaving it only on the right-hand side.


The very first thing we should tackle is each section of our website. In this case, we’re creating a simple website with two sections, a header and a main (which has the two columns).

Keeping in mind all our code goes inside the body element! We use a class to identify each section, allowing us to reference them later when we apply styling.
Now we can start filling in each section with markup based on our website design. In the header, we have a logo and a menu. The menu contains buttons (anchor links).

And the main section contains two columns:

Each column has a title

In the left column we add a vertical menu, and in the right a simple paragraph.

Here is the final code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header">
<h1 class="logo">
Logo
</h1>
<div class="menu">
<a href="https://google.com">
Go To Google
</a>
<a href="https://microsoft.com">
Go To Microsoft
</a>
</div>
</div>
<div class="main">
<div class="left-col">
<h2>Welcome</h2>
<div class="left-menu">
<a href="https://google.com">
Go To Google
</a>
<a href="https://microsoft.com">
Go To Microsoft
</a>
</div>
</div>
<div class="right-col">
<h2>Great stuff</h2>
<p>Right column text</p>
</div>
</div>
</body>
</html>
To make our webpage look the same in every browser we can include the normalize.css library. We add it the same way we add our style.css, with a link tag, but we can use a CDN link instead of storing it in our project folder.

Very important to notice that we add the link tag before our style.css, this ensures our styles override those of the normalize.css! This is the same logic as when we add a framework. Styles declared lowed in the document are more important.
Now we can focus on getting the website to look correctly. I will again do this section by section. Starting with the header.
The header contains two immediate children, .logo and .menu which should appear next to each other as columns. To do this we’ll apply:
Which will look like this:

To make our navigational links appear as buttons (larger clickable area, custom colors, etc) we have to select the actual anchor tag with our CSS. Otherwise the browser will always apply its own styling that we can’t override.
Here is how we select the anchors inside the .menu div:

By selecting .menu div first, then adding a space, and then entering the name of the anchor tag a, we are telling the browser to select all anchor elements inside the div with a class menu.
Allowing us to apply the following important styles:

Let’s review what we have so far:

Great, the header is in great shape. Let’s move to the .main element with the two columns. Step 1, make the immediate children display as columns:

Now we need to add styling to the buttons in the left column navigation, almost identical to the ones in the header, but I want the buttons to be display block, which will make them take up the full horizontal space in the left column. And add some spacing underneath with margin-bottom:

Result

Looking great, a couple more small styling improvements and we’re done.
We don’t want the right column to be directly touching the left column, so we can simply add some padding to the columns to give them a little breathing room:

Here we use a special css selector, by declaring each selector and then adding a comma between the next selector we can select multiple selectors and apply the same styling. So we’ll add 15px padding to the left column, right column, and the header. Result will look like this:

And now we just want to add a gray background to the left column:

Here is the final CSS code:
.header {
display: flex;
justify-content: space-between;
align-items: center;
}
.menu a {
display: inline-block;
text-decoration: none;
padding: 10px 20px;
color: white;
background: black;
}
.main {
display: flex;
}
.left-menu a {
display: block;
margin-bottom: 3px;
text-decoration: none;
padding: 10px 20px;
color: white;
background: black;
}
.left-col, .right-col, .header {
padding: 15px;
}
.left-col {
background: gray;
}
That’s it! You’ve created a basic website 🙂
Written by agrublev on . Posted in Uncategorized. Leave a Comment
Written by agrublev on . Posted in Uncategorized. Leave a Comment
You can view the slides here:
https://angelprivate.s3.amazonaws.com/teaching/webTechnologiesApr30.pdf
And recording here:
https://drive.google.com/file/d/18anusFv0x4XFGGdcK6hHZHGnm1y7z1ic/view?usp=sharing
Written by agrublev on . Posted in Uncategorized. Leave a Comment
Open this codepen and follow the instructions inside!
Hints:
Open this CodePen and follow the steps
Written by agrublev on . Posted in Uncategorized. Leave a Comment
I will focus on 4 Frameworks that we should consider, each was chosen for what it offers compared to the rest. To use the include code provided below simply place the entire contents inside your head!
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"> <link rel="stylesheet" href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css"> <link rel="stylesheet" href="//cdn.rawgit.com/milligram/milligram/master/dist/milligram.min.css">
<!-- UIkit CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.42/css/uikit.min.css" /> <!-- UIkit JS --> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.42/js/uikit.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.42/js/uikit-icons.min.js"></script>
Written by agrublev on . Posted in Uncategorized. Leave a Comment
Here is a quick video that goes over the process we need to follow to use a framework from our Homework number 3: