Select Page

Make an empty file named style.css. In your html page, add a line inside the tag that says . Let’s say you have some text that you want to be in a certain spot on your web page. We will put it there without a single table or line break. Put

tags around the said text. Then in the

tag itself add the attribute ‘class’ and set it equal to “test”. Now go back to style.css. Type .test {
position:absolute;
top:200px;
left:200px;
right:200px;
} Now try it in your browser. The text will pop up in an area defined by the top, left, and right pixel values. The absolute makes it’s positioning based on the entire page. If you had this text and you wanted it 200px in from the sides another div that was enclosing it, you would use the ‘relative’ value instead of ‘absolute’. Note: this example will not work in NS 4, which I will explain tomorrow.