Wednesday, 9 December 2015

HTML & CSS: There are 2 types making link/Navigation

1. Using list
<ul>
<li><a href="http://www.facebook.com">News</a></li>
<li><a href="http://www.google.com">Sport</a></li>
</ul>


2. or not using list a.k.a directly
<a href="http://www.facebook.com">News</a>
<a href="http://www.google.com">Sport</a>

This one can be easily modified.

Three things you need to do with link

1. Text-decoration
2. When visited
3. When not-visited
4. When expired
5.

Great Personality

Great personality is not like Samson. Samson is defeated by Delilah.

Tuesday, 8 December 2015

Algorithm to web design

1. Adding Divs

Switchable steps:
2. Adding border
div {
border: 1px solid hotpink;
}
3. Adding background color
4. Adding paragraph example
5. Adding width
6. Adding height
7. Adding float
8. Adding clear
9. Adding position
10. Adding margin to div except div footer

/* Remember that you already have 4 div: header div, left, right and footer. */
/* CSS code begin here */
/* Hey, please global first */
div {
border-radius: 1px;
background-color: hotpink;
}
/* <selector> { <style-style-style> } */
/* id is kress(#). Class is dot(.) */
#header {
border: 1px solid green;
height:10%;
position: relative;
}
.left {
border: 1px solid blue;
position: relative;
width: 10%;
height: 80%;
float:left;
margin-top:10px;
margin-bottom:10px;
}
.right {
border: 1px solid yellow;
position:relative;
width:89%;
height:80%;
float:right;
margin-top:10px;
margin-bottom:10px;
}
#footer {
border: 1px solid red;
position:relative;
width:100%;
height:10%;
clear:both;
}

<head>
<link type="text/css" href="mystylesheet.css" rel="stylesheet" />
</head>
<body>
<!--- We can use 2 types of naming upon a tag (for i.e. "div"): using 'id' and using 'class'--->
<div id="header"><p>This is header</p></div>
<div class="left"><p>This is left</p></div>
<div class="right">This is right</div>
<div id="footer">This is footer</div>
</body>

11. Adding content to each div. I mean replace the point (4) result.

Dealing with link
12. Adding list using external javascript
Method/Type 1:
document.getElementById("links").innerHTML = "<ul id='menu'>" +
"<li><a href='http://www.google.com'>News</a></li>"+
"<li><a href='http://www.yahoo.com'>Sports</a></li>"+
"</ul>";


Type 2:


13.
14. Manipulate the link styles point (12)
- text-decoration
- when not visited
- when visited
- when hover
14.

CSS positioning: Static, Absolute, Relative and Fixed

Static If you don't specify an element's positioning type, it defaults to static. This just means "where the element would normally go." If you don't tell an element how to position itself, it just plunks itself down in the document.

Absolute If the parent not go static, then the absolute position div is according to left.
The first type of positioning is absolute positioning. When an element is set to position: absolute, it's then positioned in relation to the first parent element it has that doesn't have position: static. If there's no such element, the element with position: absolute gets positioned relative to <html>.

To show you how this works, we've set the #outer div to have absolute positioning. This means that when you position the #inner div, it will be relative to #outer. (If #outer had the default positioning of static, then #inner would get positioned relative to the entire HTML document.)

Relative positioning is more straightforward: it tells the element to move relative to where it would have landed if it just had the default static positioning.

Finally, fixed positioning anchors an element to the browser window—you can think of it as gluing the element to the screen. If you scroll up and down, the fixed element stays put even as other elements scroll past.

Static positioning tergantung normally flow.
Absolute positioning tergantung parent.
Relative tergantung static positioning.
Fixed positioning tergantung posisi awal, scroll ke bawah tetap sama.

Seneng banget kalau menuruti perintah kita.

Monday, 7 December 2015

1. Selectors
2. Classes/IDs
3. Margins
4. Paddings
5. Border
6. Position

1. Create 4 divs. One for the header, one for the left column, one for the right column, and one for the footer. So, create 4 divs:
Answer:
<body>
<div id="header"></div>
     <div class="left"></div>
     <div class="right"></div>
     <div id="footer"></div>
</div>
</body>


2. Create border-radius each of div
Answer:
div {
border-radius: 5px;
}

3. Give your divs a height, weight and background-color. Add dimension and color to our divs.
header
{
weight:  ;
height: ;

}