Saturday, August 30, 2014

Web Development 101 - Anchor tag



Anchor tag is the tag that produces the hyperlinks on our webpage. What are these hyperlinks?

"... an icon, graphic, or text in a document that links to another file or object. The worldwide web is comprised of hyperlinks linking trillions of pages and files to one another." http://www.computerhope.com/jargon/h/hyperlin.htm

Well, below is a link that redirects you to another blog once you clicked it:


Notice that it opened in another tab and delivered you a new page.

How will we code it?

Basically, this is the syntax of an anchor tag:

<a href="#">Redirect me, please</a>

... and it looks like this on a webpage


Now, how does our hyperlinks appear on our webpage depending on its status?
  • Unvisited/unclicked hyperlink - an underlined blue text 
  • Visited/clicked hyperlink - an underlined purple text
  • Active link - an underlined red text (try holding down your left click and you'll see)

Attributes

<a href="www.google.com" id="lnk-id" target="_blank">
  • href - specifies the target location to where the user will be redirected once the hyperlink is clicked
  • id - sets the identity of the hyperlink
  • target - defines what will be the behaviour of the hyperlink once clicked. The target attribute has different values and they are as follows:
    • _blank - opens the link in a new tab
    • _self - opens the link in the same page where it is clicked
    • _parent - opens the link in its parent frame
    • _top - opens the link in its own page
    Please refer to http://www.w3schools.com/tags/att_a_target.asp for more details about the target attribute. Google is your friend  :)


Let's get it on

1. Open your favorite text editor and type the code below:

<html>
    <head>
        <title>Your webpage title goes here</title>
    </head>
    <body>
        <a href="www.google.com" target="_self">Redirect me, please</a>
    </body>
</html>

2. Save your file then open it on your browser. It should look something like this.


*Please feel free to leave comments, questions and corrections. I will promptly respond to it, promise!

Saturday, August 23, 2014

Web Development 101 - Anchor tag

Article is on its way....



Web Development 101 - HTML tags




As discussed in our previous article, we have learned that HTML tags are the syntax we follow in creating the elements of our webpages. I have given a few sample of tags on that post. In this part of our series of tutorials, I will discuss in-depth the other things we need to know about HTML tags.

Let's not beat around the bush, below is the list of the standard HTML tags we use in web development:

Anchor tag<a></a>
Body tag<body></body>
Button tag<button></button>
Division tag<div></div>
Form tag<form></form>
Head tag<head></head>
Iframe tag<iframe></iframe>
Image tag<img />
Input tag<input />
Table tag<table></table>
Lists tag<ol></ol> & <ul></ul>
Paragraph tag<p></p>
Span tag<span></span>



Also, we have text formattng tags:

itallics<i></i>
bold<b></b>
center<center></center>
subscript<sub></sub>
superscript<sup></sup>
strong<strong></strong>
emphasize<em></em>
computer output format<code></code>




The above tags are just the basics that we will encounter in coding webpages. Everything complicated on a webpage starts with those tags. Now, let's move on with the first tag, anchor tag.

Tuesday, August 19, 2014

Real Life Lessons in Programming



Let me take a break from finishing the second tutorial post. 

Being a programmer is not just something you acquire for the sake of being employed. It is a PASSION (well, this is how I love my job). In everything that we do, we must give our 101%, put our mind, body and soul for a satisfactory output that will benefit not only our users but us as programmers. Programming isn't as techy as it sounds, it also has a heart. Real life lessons are also applicable in this area:

1. "To understand is to perceive patterns" -- Isaiah Berlin. Coding requires critical thinking. Critical-mindedness helps you to see the pattern that lies behind the overall behaviour of a system. Acquiring this pattern will make our coding smooth and modular in approach.

2. "Simplicity is the ultimate sophistication" -- Leonardo da Vinci. Wow, amazing! Even master Leonardo's words of wisdom apply to today's technologies. It's true, the simpler your code will be, the better. Isn't it cool that with just a simple solution, you are able to resolve a whole system's trouble?

3. "If I have seen further, it is by standing on the shoulders of giants" -- Isaac Newton. I personally been just hearing this saying on businesses (since they talk about business giants). In programming, if you feel like you are in a situation of creating a very complex algorithm, chances are that you are in a wrong path. And chances are that somebody has already done it and shared it in the community. Check Google, he is your friend. Do not waste time, simplicity is the ultimate sophistication anyway.

4. "Do what you love and the necessary resources will follow" -- Peter McWilliams. Stop procrastinating! Stop wasting time waiting for the right timing. The right time to start doing what you love is NOW. So you love programming? So you want to create a system? Why tonight? Why later? Create the ember now. 

5. "Logic will get you from A-Z, Imagination will get you everywhere" -- Albert Einstein. Very well said Sir Einstein. It is accepted that developers are left-brained person (well, not literally of course). I mean, developers tend to be more analytic and logical. And that lies in our shortcoming. We must imagine more to  move futher. We have to imagine more to touch real-life situations where our end-users will be testing our products. We have to imagine how our project will work so that we could have a better view on how we are going to design its backend.


Programming is something very loveable. Who says programmers have no life? We are full of life, we sustain life. Be proud. Happy coding!

Saturday, August 16, 2014

Web Development 101 - HTML nuts and bolts



This is a series of tutorials that will help you learn to code HTML. Before we go getting our hands dirty (well, not literally of course), let us learn first the nuts and bolts of HTML.

Key learning words:
    Elements
    HTML tags
    Attributes

HyperText Markup Language (or HTML as we know it) is the standard markup language used to create web pages. It is what we actually see on websites. On the technical side, we use HTML to create them.

A basic webpage is  made up of different elements. These elements can be: text box, drop-down menus, buttons,radio buttons, links, divisions, tables and paragraphs (well, we'll deal with the others as we go on).

We create these elements using html tags. There are a lot of confusion over the internet on what is the difference between elements and tags. But as far as I understand it (please please please correct me if I'm wrong), the sense of these two terms is this:

         elements     -     the very object that we see on a web page
         html tags     -     the standard codes we use to create the elements on a web page
*feel free to share your thoughts with this on the comments below


HTML tags (elaboration here)
There are different tags for each element we see on a webpage. An html tag is has a opening and closing tags.

     <div>Anything goes in this part</div>

The above example is a div tag (one of the commonly used html tag). The <div> is the opening tag for the div tag while the </div> is the closing tag for the div tag.

These tags have may contain attributes, (same concept for an element having attributes). An an attribute provides additional information about the tag/element. This is usually coded inside an html tag which has a key-value pattern.

    <div id="[you_div_id]">Anything goes in this part</div>
    
The id="[you_div_id]" part is an example of an attribute that an html tag may contain. This is the "id" attribute. Notice that it is in key=value pattern meaning that some value must be put into it. The left part of the equal sign is standard while the other side is defined by us, coders.

Creating your page
We'll be hyping it up a bit on this. Below is an example of a complete code of how basically our page will be coded. 

<!DOCTYPE html>
<html>
    <head>
        <title>Your webpage title goes here</title>
    </head>
    <body>
        <div>
                [Anything goes in this part]
                Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
        </div>
    </body>
</html>

Let us figure this out piece by piece:


<!DOCTYPE html - this is the declaration tag which determines what type of document we are creating. Upon load of our code on a browser, the browser will know that this is an html file and will read the markup language we have composed accordingly.

<html>...</html> - this is the <html> tag. We ALWAYS have this tag in every html code we create. We are instructing the code that everything inside the <html> tag is html (or something executable in the web perhaps :)  ).

<head>...</head> - This is the <head> tag. This part is where we include all other head tags (tags/settings/configurations that must be preloaded or must also be initialized together with the webpage upon loading. Please don't confuse yourself with this description. We'll be dealing with this on another tutorial posts.) Example of other tags inside the <head> tag are:


  • <title> (required in the head tag)
  • <style>
  • <base>
  • <link>
  • <meta>
  • <script>
  • <noscript>

<body>...</body> - This is the <body> tag. Inside the body tag is where we start putting the elements we need to see on our webpage.  (break it down yo!)

<div>...<div> - And lastly, the div tag. (Please refer to the one discussed above, before "Creating your webpage" section. Thank yah!)

Alright, now we know what are those weird words mean to us, let us now create our page. 
Open any text editor (a notepad will do) and copy the code above (please disregard the colors). After doing so, save the file and name it as basic_page.html. We provide the file extesion .html so that our editor would know that this is an html file. Just save it where you want to save it (for now).

Nice, we have now our file, now where's the page?
Open your file using your preferred browser, or just simply locate your file and hit 'Enter'. It should display the "Lorem ipsum..." thingy that we created awhile ago. It should look like this:


*If you weren't able to achieve the same thing like the one above, please do not hesitate to leave a comment. I will surely address you guys with that.

HAPPY CODING.