I am currently studying CSS, and find that I am unclear about what position: relative is. I understand that we can use position: relative on the parent and position: absolute on its child to make the absolute positioning relative to its parent instead of the broswer.
However, when I come to the case this website, http://matthewjamestaylor.com/blog/equal-height-columns-2-column.htm, shows to me. I get stuck and do not understand what does the 2 position: relative about.
The key CSS are shown below:
body {
margin:0;
padding:0;
}
#container2 {
float:left;
width:100%;
background:orange; /* column 2 background colour */
}
#container1 {
float:left;
width:100%;
position:relative;
right:30%;
background:#fff689; /* column 1 background colour */
}
#col1 {
width:66%;
position:relative;
left:32%; /* 50% + 2%, */
}
To have a visual picture of how CSS does, you may go to http://jsfiddle.net/hphchan/631j5nLs/.
Hope one can tell me what does two position: relative is all about. I have been searching for a while, and still cannot get the answer.
Thanks.