Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS positioning, Top

Status
Not open for further replies.

ASPVBNerd

Programmer
Nov 23, 2005
83
SE
I would like to have my chart at the top, right next to the logo.

In my css I have specyfied these settings.
Code:
.container1	{
	background: #ffffff; width:163px;
	position: relative; 
	top: 1px; 
	left: 1px;

But the chart still isn't at the top of the website. The chart is inte the right and inte the middle of the page and not at the top.



George
 
How come I cannot see that code on the link you provided? If you use relative positioning, it will be positioned relative to its previous sibling, so it will lie 1px from the top and 1px from the left of the previous element in the html code. Is that really what you want?

Incidentally, I think you mean cart and not chart.
 
Vragabond, thanks for the help.
I changed from position: relative to position: absolut and it worked perfectly.
Now I learned something new.

I mean cart and not chart.

Many thanks Vragabond.

George
 
If you use relative positioning, it will be positioned relative to its previous sibling
Not so. Relative positioning positions an element relative to its normal position in the docment flow - so the code given would put the element one pixel lower and to the right than it would otherwise be.

Absolute positioning positions the element relative to the nearest parent element that is itself positioned either absolutely or relatively. Failing that, it's positioned relatively to the whole document.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top