473,503 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Centering an Image bigger than the screen

I thought I had seen this done on another site but I can't find it. I want
to have a header at the top of the page, centered, no matter the resolution.
I got it working with an ugly scroll bar at the bottom. The image is 1600px
because that is the maximum resolution I want it to work at. Any
suggestions? The site is here:

http://members.optusnet.com.au/spike...ions/test.html

and the css I used is here:

#header {
position: absolute;
top: 0px;
left: 50%;
margin-left: -800px;
}

--
-Robert Smith
----------------------------------------------------------------------------
---------------------------------
Remove 'nospam.' from my email address if you wish to reply via email.
Jul 20 '05 #1
6 4781
Robert Smith wrote:
I thought I had seen this done on another site but I can't find it. I want
to have a header at the top of the page, centered, no matter the resolution.
I got it working with an ugly scroll bar at the bottom. The image is 1600px
because that is the maximum resolution I want it to work at. Any
suggestions? The site is here:

http://members.optusnet.com.au/spike...ions/test.html

and the css I used is here:

#header {
position: absolute;
top: 0px;
left: 50%;
margin-left: -800px;
}


Set the image as a background-image in the CSS file. Don't forget
suitable ALT text, of course.
Matthias

Jul 20 '05 #2
Matthias Gutfeldt wrote:
Robert Smith wrote:
I thought I had seen this done on another site but I can't find it. I
want
to have a header at the top of the page, centered, no matter the
resolution.
I got it working with an ugly scroll bar at the bottom. The image is
1600px
because that is the maximum resolution I want it to work at. Any
suggestions? The site is here:

http://members.optusnet.com.au/spike...ions/test.html
and the css I used is here:

#header {
position: absolute;
top: 0px;
left: 50%;
margin-left: -800px;
}

Set the image as a background-image in the CSS file. Don't forget
suitable ALT text, of course.


Gobbledygook :-). Naturally there's no ALT text when the image is a
background-image. What I meant is provide some useful content that is
visible when the image is not displayed (usually because CSS is turned off).
Matthias

Jul 20 '05 #3

"Matthias Gutfeldt" <sa************@gmx.net> wrote in message
news:2i************@uni-berlin.de...
Matthias Gutfeldt wrote:
Robert Smith wrote:
I thought I had seen this done on another site but I can't find it. I
want
to have a header at the top of the page, centered, no matter the
resolution.
I got it working with an ugly scroll bar at the bottom. The image is
1600px
because that is the maximum resolution I want it to work at. Any
suggestions? The site is here:

http://members.optusnet.com.au/spike...ions/test.html

and the css I used is here:

#header {
position: absolute;
top: 0px;
left: 50%;
margin-left: -800px;
}

Set the image as a background-image in the CSS file. Don't forget
suitable ALT text, of course.


Gobbledygook :-). Naturally there's no ALT text when the image is a
background-image. What I meant is provide some useful content that is
visible when the image is not displayed (usually because CSS is turned

off).

Then I can't make the image a link :(
Jul 20 '05 #4
Els
Robert Smith wrote:
"Matthias Gutfeldt" <sa************@gmx.net> wrote in message
news:2i************@uni-berlin.de...
Matthias Gutfeldt wrote:
Robert Smith wrote:

I thought I had seen this done on another site but I can't find it. I
want
to have a header at the top of the page, centered, no matter the
resolution.
I got it working with an ugly scroll bar at the bottom. The image is
1600px
because that is the maximum resolution I want it to work at. Any
suggestions? The site is here:
http://members.optusnet.com.au/spike...ions/test.html

and the css I used is here:

#header {
position: absolute;
top: 0px;
left: 50%;
margin-left: -800px;
}

Set the image as a background-image in the CSS file. Don't forget
suitable ALT text, of course.


Gobbledygook :-). Naturally there's no ALT text when the image is a
background-image. What I meant is provide some useful content that is
visible when the image is not displayed (usually because CSS is turned
off).


Then I can't make the image a link :(


Not for real, but you can set a transparent 100% wide pic
over it, which you make is clickable.

I think there's another way though: put the pic inside a div
with overflow:hidden in the style, and no scrollbar will be
caused by the header.
Make sure the div is seperated from the content, or else
your text will also be hidden in smaller windows.

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -

Jul 20 '05 #5
> > > Robert Smith wrote:

> I thought I had seen this done on another site but I can't find it. I> want
> to have a header at the top of the page, centered, no matter the
> resolution.
> I got it working with an ugly scroll bar at the bottom. The image is
> 1600px
> because that is the maximum resolution I want it to work at. Any
> suggestions? The site is here:
>
>

http://members.optusnet.com.au/spike...ions/test.html
>
>
> and the css I used is here:
>
> #header {
> position: absolute;
> top: 0px;
> left: 50%;
> margin-left: -800px;
> }
Set the image as a background-image in the CSS file. Don't forget
suitable ALT text, of course.


Gobbledygook :-). Naturally there's no ALT text when the image is a
background-image. What I meant is provide some useful content that is
visible when the image is not displayed (usually because CSS is turned

off).

Then I can't make the image a link :(


Not sure, but this might work:

HTML:
<div id="header">
<a class="headA" href="./">&nbsp</a>
</div>

CSS:
a.headA {
background: url(header_extended.gif);
padding: 0; margin: 0; border: 0;
height: [the height of "header_extended.gif"];
width: 100%;
}

Would this do it?
Jul 20 '05 #6
Robert Smith wrote:
I want
to have a header at the top of the page, centered, no matter the resolution.
I got it working with an ugly scroll bar at the bottom. The image is 1600px
because that is the maximum resolution I want it to work at. Any
suggestions? The site is here:

http://members.optusnet.com.au/spike...ions/test.html

and the css


#header { overflow:hidden; }

Stupid idea. Make background and text different images.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
I'm looking for work | Etsin työtä
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
5715
by: George Ziniewicz | last post by:
.. I try to use CSS when possible, though I am still learning and don't maximize its use. In particular, I still use a table to provide for a centered image in a few slideshows (though table...
2
2226
by: Ryan W Sims | last post by:
I'm having trouble with centering in IE... http://www.ryanwsims.com/koh/ The image should center over the text. It does in Firebird, but not in IE for some reason. If you look at ...
17
2491
by: Applebrownbetty | last post by:
Hi, I'd like to append/amend the following code from the Dreamweaver extension "Open Picture Window Fever" for the ability to center the PopUp window: By default, it allows the window to be...
14
11016
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
6
2300
by: Jerry Camel | last post by:
I want to center an image on the screen and have text centered over the image. What's the best way to do this? I've been playing with style tags and I can get the stuff to center automatically...
3
2480
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
2
1569
by: TomTH | last post by:
I've written a program using a number of forms which runs perfectly on a 14" screen and you know the story....... on a bigger screen it all sits up in the top left hand corner. Ok I can scale it to...
1
3893
by: alokw | last post by:
Hi everyone, Here's my problem. I'd like to revamp my web site, and I have this idea. I want to create essentially a border around the screen of about 100 pixels of just black. Heres where...
4
2214
by: Peter May | last post by:
Hi. I know the dimensions area visible on the screen and I would like to picture that there put dynamically, match its size to the window, while retaining the proportions of course. For...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.