Monday, February 2, 2015

learn HTML from scratch

Thank you codecademy!
Almost from scratch, this glossary can be a good reference to HTML.
I just learned it from this awesome website, I followed the pace as if I were a 10 years old guy.

Some detailed notes about texts:
To use the colors that can be used in CSS, like in the "style" attribute of the <p> or <h2> tag, we write something like this: <p style="color: violet"> text goes here ...
Well, the list of colors can be found here.

As for the font type of a text, which is used for example in a listed item like this:
<li style="font-family: Arial">text goes here...
The list of fonts is here.

I noticed that in the value of the font-size attribute, when used for example like this in the h3 tag:
<h3 style="font-size: 14px">text goes here...
the px (pixels) has to be connected to the assigned number (14 in the example).

It's inspiring how the background-color in the style attribute affects the whole body, e.g.
<body style="background-color: brown">text may go here
it's a pity that this same background-color maybe has no effect when used in the <title> tag.

     About text sizes:
I noticed in my nearly 15 inch Toshiba laptop that
<p style="font-size: 1em">
is the same as
<p style="font-size: 16px">

     About text fonts:
1) Three font-family property values are built-in by default (serif, sans-serif, and cursive), and the rest can be imported (I should not rely on the installed fonts in a user's computer).
2) In case we suspect that the font might not exist on the user's computer, we can put another one next to the first, so if it didn't find the first it takes the next, e.g.
<p style="font-family: Verdana, cursive, serif">

The style="font-weight: bold;" is also interesting and probably an alternative to <strong>;
and style="text-decoration: underline" is an alternative to <em>.

      About texts:
&lt; is the <
and &gt; is the >

About images:
<img> is a self closing tag meaning it is
 <img src="https://www.google.com.lb/images/srpr/logo11w.png"/>
and not  <img src="https://www.google.com.lb/images/srpr/logo11w.png"> ... </img>

About tables:
A cell can merge into another one(s) to the right, e.g. this one spans till  1 cell further
<td colspan="2">....

The border attribute sets the border to the whole table
<table border="1px">
 while
<table style="border-collapse:collapse;"> <!-- this removes all borders of the table-->
usually allows any cell to specify the padding of the row
<th style="padding: 2px">
and the thickness of side border
<td style="border-left:1px solid black;"> <!--or-->
<td style="border-right:1px solid black;"> <!--or-->
<td style="border-top:1px solid black;"> <!--or-->
<td style="border-bottom:1px solid black;"> <!--or-->
<td style="border:1px solid black;">

<div> is useful to create hyper-linked menu items, and to affect a division (section) with CSS.
(More on the attributes of the div can be found in the "Working with CSS" post in this blog.)

<div> works with CSS on a section level, while <span> works on small scale (like a work or letter).

another tag:
<button>Click me!</button>
probably the button is not a block by default.

another tag:
<br/> this goes down a line.

About forms:
<form name="Form1">
       <input type="text" name="EntryItem" value="default value" />
</form>

outline-color: red;   this is a style that can be put in the input tag, it turns the color of the edge of the input box into red.
outline-style: solid;   this one is needed in Firefox in order for the outline-color to work.







No comments:

Post a Comment