473,568 Members | 2,939 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 4788
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
resolutio n.
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.


Gobbledygoo k :-). 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_exte nded.gif);
padding: 0; margin: 0; border: 0;
height: [the height of "header_extende d.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
5720
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 vertical align doesn't work in Mozilla): http://zintel.com/homepics.html I've used combinations of <center>, style align 'center', table cell...
2
2231
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 http://www.ryanwsims.com/sd.php everything's fine (i.e. centered)
17
2502
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 offset on the left and top, but does not include a centering option. I'm thinking it would include something like (screen.width-imageWidth)/2;...
14
11039
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 window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin =...
6
2303
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 OR have the text appear on top of the image. But in the second case, the image and text aren't centered properly. Any help is appreciated... ...
3
2490
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 image but I have had varying results on multiple images. Is there anyway to make the text a fixed size on the image. Similar to putting a date...
2
1575
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 fit in the middle and still look like a 14" program running in a bigger screen which is fine too. But then when going back to the smaller monitor, its...
1
3903
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 it gets tricky: In the middle area which is not touched by the border should be an image that I have created that is excessively
4
2221
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 example: Screen area visible: 1280x589 The picture size: 3008x2000
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7916
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2101
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 we have to send another system
0
932
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.