Take Some Code
Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Tuesday, March 6, 2012

HTML L*^%$

Hello!
Greetings bloggers and other people who get to this blog via random search words on Google.
To figure out today's subject you are going to have to click here.


































































































































Click here to test a link that doesn't open a new window.


















































































































































































Linking! (But maybe you could guess that from the post title...)
How it works
I have mentioned the <a> tag a couple of times now and figured that we could do with a little demonstration of some of the things it can do... 

The code I used above to get you all the way down here was:
a) <a href="http://takesomecode.blogspot.com/2012/03/greetings-bloggers-and-other-people-who.html#allthewaydown">Here</a>
(The link that you clicked...)

and

b) <span id="allthewaydown">Linking! (But maybe yo.......)</span>
(The spot the link took you to...)
While you probably already utilize the <a> tag on your blog, you might not have known about the possibility of using it like I did.
The <a> tag can provide hyper-linking not only to other pages, but also within the same page or other pages.



Here is how it's done in a step-by-step guide:
*If you want to have a post with any code you'll need to edit the HTML of the post and add it there...

1) First you need to have the spot you want it to link to. I used the <span> tag to do this but you can also use the <img>, <div>, <a>, and many other HTML tags. The key is in assigning that tag a particular value as an "id" as I did.


<span id="allthewaydown"></span>


While a variety of characters can be used it is best to keep it simple with lowercase letters and no numerals. Numerals can't be used at the beginning of the phrase anyway so I tend to do without them as much as I can.


2) Place whatever title or image you wanted to link to in between the <span> (<img>, <div>) tags.


<span id="allthewaydown"> WHATEVER YOU ARE LINKING TO </span>


3) Create the link using the <a> tag.
Here is the formula for links: Whatever page contains the stuff you're linking to + # + the id name.
So...

<a href="blahblahblah#allthewaydown">Word to click</a>


4) Decide whether or not to have the link open in another page.
Use good judgement with this as many users might become frustrated if every link they click on your site results in a new window or tab. If you want the link to open in a new tab or window simply include: target="_blank" inside of the <a> tag.

<a href="blahblahblah" target="_blank">Words used for link</a>


5) Done. Be sure to test all your links that way users don't encounter any errors.


For an example of opening another window or tab click here.
For another in page example click here.
For easy to use code click here.

Thanks for reading!
Enjoy the code!
As always please leave a comment if you have any questions or requests for code!
-Mike @ Take Some Code

P.S. What do you think of my blog button? Pretty cool eh? (hold mouse over it)

Saturday, March 3, 2012

HTML Basics


Introductions...
Hello my name is Mike and I am the wonderfully fantastic husband of Alyx from Everyday is a New Adventure.

I have created this blog as a means of sharing HTML, javaScript, CSS, and other types of code.
Followers will receive daily ideas and code tips to improve their own blog and learn some web design in the process.

Without further ado... I will now introduce HTML.

HTML is a computer programming language designed for the world wide web.
It is also an acronym that stands for Hyper-text Markup Language.


Those who remember the beginnings of the internet will remember a time when dial-up abounded with it's silly tones and websites were plain and boring.Most websites consisted of just text and maybe a few pictures and standard links.


The term mark up refers to adding marks or annotations to a document so that they are not displayed, but rather show the browser how to display something.

HTML consists of elements which each tell the browser to do something different.
You use many of them already I'm sure while blogging such as the break element <br /> or the image element <img... />. A web browser's job such as Google Chrome, Firefox, IE, or Safari is to read a webpage file like "index.html" and then display the page as it says to in the file.

A webpage can be created in just 9 lines of code:
<html>
<head>
<title>Title of your webpage
</title>
</head>
<body>
Whatever you want to display on the page
</body>
</html>

Now to explain it.
<html> - tells the browser that everything after that line is part of the webpage.
<head> - tells the browser that after this line is where you can put stuff that you don't want to show up in the body.
<title> - creates the title of the webpage and </title> ends the title.
</head> - ends the head section.
<body> - begins the body section where you put all of the pages content including pictures, text, links, and more.
Between the <body> and </body> is content.
</body> - closes the body section
</html> - ends the webpage.

And that's it. To create your own webpage all you would have to do is put these 9 lines of code into a standard text document, and then rename the extension from "textdocument.txt" to "textdocument.html" and now you have created a webpage.

Here is a step by step guide:
1) Create a text document on PC or MAC
2) Edit the document in a text editor such as Notepad (PC) or TextEdit(MAC)
3) Copy the code above by selecting it pressing Ctrl + C or Apple key + C
4) Paste the code in the text document by pressing Ctrl + V or Apple key + V
5) Save the text document and close it
6) Rename the text document from "TextDocument1.txt" to "whateveryouwant.html"
7)Done. Double click on the new file to open it in your default browser.
or
YouTube tutorial made by me... Enjoy the background music because I made that too...


That's all for today... I don't want to bore you with too much code, but for those looking for a freebie webpage built just like the example above Take Some Code here.

Have a good one!
(c) 2012 Take Some Code