Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-31-2013, 10:52 AM   PM User | #1
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
CSS image help

Hi

I have a image at the top of my page and is in the right place on my 1024 x 768 screen but when looking at it on my second screen which is a 1280 x 768 I think, it appears off the page, how do I set it so it appears in the same place on both screen sizes

The css I got for it is below

Code:
img.homeimg {
margin: -30% 0 0 -25%;
position: fixed;
z-index: 10;
}
ianhaney is offline   Reply With Quote
Old 01-31-2013, 04:02 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
I don't think your margin is helping things. I bet you used that to position your image. Since you are doing position: fixed; try using the top and right to position it.
Example not a position:
Code:
position: fixed;
top: 0px;
right: 10px;
z-index: 10; //think this is needed??? Your call
}
sunfighter is offline   Reply With Quote
Old 01-31-2013, 04:14 PM   PM User | #3
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
I have managed to solve the image issue now but got couple of other small issues

The nav menu on the side is in the correct place on my 1024 screen but is out of place on the 1280 screen

The website is www.irhwebsites.co.uk/bedazzled
ianhaney is offline   Reply With Quote
Old 01-31-2013, 05:22 PM   PM User | #4
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
Ian, I'm using firefox ver 18.0.1 and your site has no nav menu on the side. All I see is an image and then a centered strip that 610 px wide that contain words and images until you get to the words
Quote:
These are key skills that stay with our students for life whatever paths they
at that point the strip goes to 444px by sucking in the right side.
Think you lost your css styling.

OK I found your problem. Stop using position:fixed; position: relative; or position: absolute; Use the normal flow of html and I think you'll solve all your problems.
BTW the nav was under the strip because you used position: fixed; on it. I have a 1440px wide screen and mine is small.

Last edited by sunfighter; 01-31-2013 at 05:29 PM..
sunfighter is offline   Reply With Quote
Old 01-31-2013, 05:23 PM   PM User | #5
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
Hi

Thank you for the reply

I have not done the CSS for firefox yet, only done it for Chrome at the mo, once it looks right in Chrome then I will do it for Firefox and IE
ianhaney is offline   Reply With Quote
Old 01-31-2013, 05:41 PM   PM User | #6
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
Ian if you program correctly in Chrome or Firefox it should work in all browsers with very little difference in the rest of them. Cross Your Fingers.

Again I say
Stop using position:fixed; position: relative; or position: absolute; Use the normal flow of html
sunfighter is offline   Reply With Quote
Old 01-31-2013, 07:26 PM   PM User | #7
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
Cool so I should be taking out the position on the image and anywhere else I have got position
ianhaney is offline   Reply With Quote
Old 01-31-2013, 08:10 PM   PM User | #8
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
position:fixed; position: relative; or position: absolute;
are not the way to place most things in html. There are exceptions, but I'm not sure you need them.

You have your work cut out for you. You are basically starting over. I'd put one element in at a time just like you did not have a page and were just beginning to code it.
sunfighter is offline   Reply With Quote
Old 01-31-2013, 08:53 PM   PM User | #9
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
I am winning, thank you for the info and advice appreciate it

One thing, on my #nav, I got position: fixed as it scrolls with the website, if I comment that out, it just stays at the top, is there another way of having it scroll with the site if I take out the position: fixed
ianhaney is offline   Reply With Quote
Old 01-31-2013, 09:33 PM   PM User | #10
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
No. If your going to use position: fixed put it someplace where it's not going to get over run by your main div and so it don't extend below most browsers.
sunfighter is offline   Reply With Quote
Old 01-31-2013, 10:40 PM   PM User | #11
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
That's the trouble my customer want's the nav menu right up against the center panel

see www.irhwebsites.co.uk/bedazzled

Also it looks on the 1024 screen but on my 1280 screen, it is not in line with the top of the center panel if that makes sense

I have attached a screen shot so you see what I mean

the screenshot is at the link below

http://www.irhwebsites.co.uk/bedazzl...azzleissue.png
ianhaney is offline   Reply With Quote
Old 01-31-2013, 11:05 PM   PM User | #12
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,383
Thanks: 18
Thanked 350 Times in 349 Posts
sunfighter is on a distinguished road
So why not make a picture of what it is suppose to look like and tell us which element they want to travel down the screen with them and what they want them t hook to etc.
sunfighter is offline   Reply With Quote
Old 02-01-2013, 08:11 AM   PM User | #13
ianhaney
New Coder

 
Join Date: Apr 2012
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
ianhaney is an unknown quantity at this point
That screenshot

On the left is the 1024 screen size and is how it should look and on the right is my 1280 screen size and see the nav menu is not in line with the center panel like the one on the left

How do I get that nav menu to line up like the one on the left
ianhaney is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:21 PM.


Advertisement
Log in to turn off these ads.