9 replies [Last post]
AaronInSH
AaronInSH's picture
User offline. Last seen 1 year 46 weeks ago. Offline
newbie
Timezone: GMT+8
Joined: 2010-03-14
Posts: 7
Points: 9

Hi

I have a few divs that I created in my header. The problem is that they appear in a different location when viewed on different PC/browsers.

Im using absolute positioning and here is the code -
<div style="position:absolute; top:60px; left:775px; width:68px; height:22px;">

On my PC the social media icons display flush on the right side of the header, which is where I want them (see attached image). But on some other PCs they show up near the middle of the header.

Any help would be appreciated.

CupidsToejam
CupidsToejam's picture
User offline. Last seen 2 weeks 1 day ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

My network blocks all image

My network blocks all image hosting sites, so i cant see the image. Can you provide a link to the webpage?


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com

Deuce
Deuce's picture
User offline. Last seen 3 days 8 hours ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2005-11-20
Posts: 4416
Points: 1835

Why are you using absolute

Why are you using absolute positioning?

all ยป http://dictionary.reference.com/browse/all

Google isn't a bunch of guys reading and grading web sites, it's more like a bunch of monkeys sniffing food and putting the good bananas at the top. -Triumph

AaronInSH
AaronInSH's picture
User offline. Last seen 1 year 46 weeks ago. Offline
newbie
Timezone: GMT+8
Joined: 2010-03-14
Posts: 7
Points: 9

@cupidstoejam

@cupidstoejam http://virgintees.com/

@deuce because I'm a noob at CSS haha. How should I be positioning it?

CupidsToejam
CupidsToejam's picture
User offline. Last seen 2 weeks 1 day ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

Please do not use css

Please do not use css positioning until you fully understand how they behave. But to answer the question, add position: relative; to body.custom div#header. You will need to adjust it some.


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com

AaronInSH
AaronInSH's picture
User offline. Last seen 1 year 46 weeks ago. Offline
newbie
Timezone: GMT+8
Joined: 2010-03-14
Posts: 7
Points: 9

just to make sure I

just to make sure I understand you...positioning it relative to the header will make it look uniform on all browsers and screen resolutions? right?

CupidsToejam
CupidsToejam's picture
User offline. Last seen 2 weeks 1 day ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

Why dont you go out and learn

Why dont you go out and learn how css positioning works and behaves.

http://www.w3schools.com/default.asp

has a great testing environment.


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com

AaronInSH
AaronInSH's picture
User offline. Last seen 1 year 46 weeks ago. Offline
newbie
Timezone: GMT+8
Joined: 2010-03-14
Posts: 7
Points: 9

excellent link. thanks!

excellent link. thanks! Looks a lot more thorough than the book I picked up.

I'm on a bit of a deadline to finish this site so is this code I should add?

body.custom div#header {position:relative;}

CupidsToejam
CupidsToejam's picture
User offline. Last seen 2 weeks 1 day ago. Offline
rank Guru
Guru
Timezone: GMT-6
Joined: 2008-08-15
Posts: 2634
Points: 1552

yes, you already have

yes, you already have body.custom div#header in your css, just add position:relative; to the existing css


First basic few steps in building a webpage
1. Gather and collect content.
2. Organize the content into meaningful semantic valid HTML
3. Design the prototype
4. Style using CSS

http://www.pixelbehavior.com

AaronInSH
AaronInSH's picture
User offline. Last seen 1 year 46 weeks ago. Offline
newbie
Timezone: GMT+8
Joined: 2010-03-14
Posts: 7
Points: 9

Ok, will give it a go and

Ok, will give it a go and report back tmrw when I have a chance to test it on other PCs. Thanks again Smile