#1 2007-11-13 16:44:41
- PeterP
- Member

- From: New York City
- Registered: 2005-09-21
- Posts: 71
- I've been thanked 1 times.
-
absolute or relative positioning
I'm trying to redo some stuff on my website to put more code into CSS.
I have a box that centers in the browser and all the elements go within that.
this is my style for the container:
Code: html
#wrapper2 {
text-align:left;
width:784px;
margin:0 auto;
height: 1000px;
} I'm using div's as layers within this box to position items.
If I use absolute positioning, the items won't move with the centered div.
If I use relative positioning I have to use negative numbers in some places to get the layer where I want it. I've read that this can cause the bots to think it's hidden content and cause problems with ranking.
Should I worry about using negative numbers?
I don't have the page posted anywhere yet, will do tonight if it's helpful.
P
Offline
#2 2007-11-13 17:40:03
- aknet47
- Member
- From: vienna
- Registered: 2006-09-14
- Posts: 230
- I've been thanked 1 times.
-
Re: absolute or relative positioning
You have to add position: relative to the style
Code: css
#wrapper2 {
position: relative;
text-align: left;
width: 784px;
margin: 0 auto;
height: 1000px;
}
Now the nested div references to itīs parent
Last edited by aknet47 (2007-11-13 17:41:44)
Iīve got a blog
Offline
#3 2007-11-14 00:35:18
- Ryan_steyn
- Member

- From: South Africa, Port Elizabeth
- Registered: 2006-08-23
- Posts: 1673
- I've been thanked 26 times.
-
Re: absolute or relative positioning
Make sure this is in your body... (css stylesheet)
Code: css
body {
margin:0px;
padding:0px;
text-align:center;
}
Then you can set your main box like so
Code: css
#wrapper {
width:960px;
margin:0 auto;
text-align: left;
}
That will keep everything in the center of your browser window. nice n neat.
Last edited by Ryan_steyn (2007-11-14 00:39:22)
Lalibela Game Reserve in malaria free South Africa
"Humans are by far the most fascinating creatures, in a universe with no boundaries and a world with so much unfound wonder we are the only entities capable of creating boredom"
Offline
#5 2008-05-03 10:25:34
- barry
- Member

- From: Dundee Scotland
- Registered: 2006-07-19
- Posts: 67
- I've been thanked 0 times.
-
Re: absolute or relative positioning
Ryan_steyn wrote:
Make sure this is in your body... (css stylesheet)
Code: css
body {
margin:0px;
padding:0px;
text-align:center;
}
Then you can set your main box like soCode: css
#wrapper {
width:960px;
margin:0 auto;
text-align: left;
}
That will keep everything in the center of your browser window. nice n neat.
I dont think so ?
your method wont work in Firefox which is my browser and around 20% of peoples browser of choice these days
To centre your div which is the main container for your other stuff you will do this
Code: css
#MAINDIV {
position:relative;
margin-left:auto;
margin-right:auto;
width: whatever you like here;
}
You can then do whatever you like with the internal elements and use relative or absolute to position them.
Last edited by barry (2008-05-03 10:26:37)
Offline
#6 2008-05-05 09:23:36
- Steven_A_S
- Member

- From: San Antonio, TX
- Registered: 2006-08-07
- Posts: 443
- I've been thanked 21 times.
-
Re: absolute or relative positioning
Actually, the text-align:center; is a fix for IE. Note Ryan still uses margin:0 auto; for Firefox, though he did forget the position:relative; necessary for setting position for internal objects.
You don't have to set margin-right and margin-left separately, by setting margin:0 auto; he effectively set margin-top:0; margin-bottom:0; margin-left:auto; and margin-right:auto; in a way that saves space.
Offline
#7 2008-05-06 08:21:27
- overklokan
- Member

- Registered: 2008-05-06
- Posts: 18
- I've been thanked 1 times.
-
Re: absolute or relative positioning
Hmmm first time hearing that negative values could screw up ranking!
Offline
#8 2008-05-06 08:23:59
- barry
- Member

- From: Dundee Scotland
- Registered: 2006-07-19
- Posts: 67
- I've been thanked 0 times.
-
Re: absolute or relative positioning
overklokan wrote:
Hmmm first time hearing that negative values could screw up ranking!
Ive never heard of this either, if google did penalize for this action surely this would screw the rankings of millions of sites?
Using negative values in CSS is common place, I use it allot to align divs and images...
Ive been doing SEO for years and never noticed or ever read about such an issue
Offline
#9 2008-05-06 09:31:47
- Northie
- Moderator

- From: Yorkshire, UK
- Registered: 2006-08-19
- Posts: 2592
- I've been thanked 62 times.
-

Re: absolute or relative positioning
PeterP wrote:
I'm using div's as layers within this box to position items.
If I use absolute positioning, the items won't move with the centered div.
If I use relative positioning I have to use negative numbers in some places to get the layer where I want it. I've read that this can cause the bots to think it's hidden content and cause problems with ranking.
Should I worry about using negative numbers?
if the margins are small (less than 50px) then you should be OK
using margins like 5000px or -1000px will obviously place the content off the screen.
Google does look for large negative numbers and will interpret it as hidden content, the same is true for elements that have the style display:none;
overklokana and barry - if you've not heard of this and you're in the web game, then I suggest you get your act together and research some basic white-hat on page SEO strategies.
Now taking free-lance inquiries; Please contact me for more details
Internet Marketing Books
Promote Yourself on Site Reference!
Offline
#10 2008-05-06 11:39:56
- overklokan
- Member

- Registered: 2008-05-06
- Posts: 18
- I've been thanked 1 times.
-
Re: absolute or relative positioning
I had enough of SEO crap ... You see, for my business I don't need SEs at all ... I refuse
to accept that there's only one way of doing something cause I see that as "success" mass
mania driven with greed ... Mindless, comply-with, one way road ... Not for me! You might be
right about negative values but still, even if I don't comply with that I will get 100+ highly
targeted unique visitors per day (even if my site is under construction) ... Later those numbers
will go to 1.000 and 10.000 easy, without even thinking of Google or any other SE ... I truly
don't like the idea of running business that depends on some person's or company's rules!
If I would go and do it Google's way I would need to remove most of my design ideas, most
of my backlinks (including those that send me good traffic but are PR 0), increase site
weight a lot (add all titles and alts than fight ugly tool tips), bother with title/description/content
keywords and their positioning inside text, submit new site maps every few days and many
other things ... I simply don't want to do that ... Those of you that do it, remember = Google is
now but it won't be forever ... Failing to develop secondary plan is very bad in long run ...
Last edited by overklokan (2008-05-06 16:45:44)
Offline
#11 2008-05-06 19:03:59
- Nic
- Administrator

- Registered: 2006-07-07
- Posts: 1653
- I've been thanked 57 times.
-

Re: absolute or relative positioning

overklokan wrote:
Failing to develop secondary plan is very bad in long run ...
very well said 
free SE traffic is great- if you can get a top ranking for a highly searched term in your industry that's like getting free real estate on 5th ave which is a huge bonus
but yes, relying on SE traffic alone, while potentially very rewarding at the moment, could have nasty consequences if anything was ever to go wrong
the more diversified your traffic sources can be the better!
Reward Your Visitors and Keep Them Coming Back By Giving Them Books For Free
Online
#12 2008-05-07 02:03:59
- Northie
- Moderator

- From: Yorkshire, UK
- Registered: 2006-08-19
- Posts: 2592
- I've been thanked 62 times.
-

Re: absolute or relative positioning

I agree that there are hundreds of ways of getting traffic to your site, but unless you've got lots of $$$ to do your marketing with, the bulk of it will come from the search engines, and getting more traffic from the SEs is always possible
I only build websites to make money, most of the sites are mine and work by affiliate, PPC schemes. To make money I need visitors to find my sites, click on ads and buy products; and i have the following metrics to work with
popularity of the subject/keyword
competition (who else is tagetting the same things)
Click through rate to my site
Click through rate from my site to the advertisers
cost per click/sale
I can now work on optimising each of those metrics for better results.
I know that people search for products using search engines - for those people I build sites and pages that do well in the search engines. For the other 1%.....it's joust not worth the time at the moment
There's no right or wrong way to go about SEO, some methods work well for some and not others; but for long term results it is best to keep your onsite SEO in line with the SEs best practice guide - it'll be best for the user as well (in most cases)
Now taking free-lance inquiries; Please contact me for more details
Internet Marketing Books
Promote Yourself on Site Reference!
Offline
#13 2008-05-07 03:24:39
- barry
- Member

- From: Dundee Scotland
- Registered: 2006-07-19
- Posts: 67
- I've been thanked 0 times.
-
Re: absolute or relative positioning
barry wrote:
overklokan wrote:
Hmmm first time hearing that negative values could screw up ranking!
Ive never heard of this either, if google did penalize for this action surely this would screw the rankings of millions of sites?
Using negative values in CSS is common place, I use it allot to align divs and images...
Ive been doing SEO for years and never noticed or ever read about such an issue
Slight misunderstanding..
negative values will not screw up search rankings, hidden content using negative values (if you get caught) will have an adverse effect on your search rankings
Offline
#14 2008-05-07 06:01:00
- Northie
- Moderator

- From: Yorkshire, UK
- Registered: 2006-08-19
- Posts: 2592
- I've been thanked 62 times.
-

Re: absolute or relative positioning
barry wrote:
negative values will not screw up search rankings, hidden content using negative values (if you get caught) will have an adverse effect on your search rankings
Exactly, and the algorithms to catch you are some of the less-well investigated aspects of SEO research
Now taking free-lance inquiries; Please contact me for more details
Internet Marketing Books
Promote Yourself on Site Reference!
Offline
| Never |
- Sponsored Results
|
|