Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 08-15-2006, 06:51 AM Background size help
Elly's Avatar
Junior Talker

Posts: 3
Trades: 0
I didn't know if this belonged in the CSS forum or here, sorry!

I know different size monitors have an impact on how a webpage can look.
For example, on my monitor it comes up like this:



But on a friends monitor it comes up like this:


As you can probably tell the red/black image is the background image and I've got this as coding:

Code:
<style type="text/css">

.extra{
background-repeat:no-repeat
}
</style>

<body background="http://img125.imageshack.us/img125/2104/hospitalcopyjh5.jpg" class="extra" bgcolor="#120404">
*bg color= the black, which you can see a lot of on my friends screenshot.

Thing is though, I don't want the plain black, I want the whole background image to go across.

Is there a code for this? Or do I need to make the background image bigger? Do you suggest a size?

Thanks!
Elly is offline
Reply With Quote
View Public Profile Visit Elly's homepage!
 
 
Register now for full access!
Old 08-15-2006, 07:05 AM Re: Background size help
Coulix's Avatar
Average Talker

Posts: 16
Trades: 0
A common problem

When i run into this problem i either accept that there are people out there with 50 inch monitors, or just center the page so that it looks good in most monitor resolutions.

You dont really want anyone to see the page too large for their view, gives a very bad impression.

As a rule of thumb, i usually make my site fit nicely for 1024x768 or 1280x1024, which are the more common resolutions these days.


An alternativ solution could be to use a design that streches over the whole screen, and have center graphics that looks nice even if the site is streched or minimalized. A friends website is a good example if you look at his header and try to resize the browser window, gives you an idea of what i mean.
.:: Screaming Art Designs ::..

Good luck whatever you choose
__________________
NorthCube, Webtechnology from the north.

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
.
To avoid criticism do nothing, say nothing, be nothing. - Elbert Hubbard, 1856 - 1915.
Coulix is offline
Reply With Quote
View Public Profile
 
Old 08-15-2006, 07:47 AM Re: Background size help
Elly's Avatar
Junior Talker

Posts: 3
Trades: 0
I tried centering the image but it left a large black space at the bottom, but that's okay. Heh.
I'll take into account your rule of thumb, maybe it will become my rule of thumb also!
With that layout I didn't want to redo it all again so I centered it, kept the black background and made the image blend in into it by having a black/red gradient at the edges. Looks much better than it did!

Thanks for your help it's greatly appreciated.
Elly is offline
Reply With Quote
View Public Profile Visit Elly's homepage!
 
Old 08-15-2006, 08:30 AM Re: Background size help
Oneway's Avatar
Skilled Talker

Posts: 71
Trades: 0
For a sleazy solution:

CSS:
Code:
html, body {
  padding: 0px;
  margin: 0px;
}
#bglayer {
  position:absolute;
  z-index:1;
  top:0px;
  left:0px;
  width:100%;
  height:100%;
}
#bglayer img {
  width: 100%;
  height: 100%;
}
#content {
  position:absolute;
  z-index:2;
  top:0px;
  left:0px;
}
and the HTML that goes with it:
Code:
<html>
  <body>
    <div id="bglayer">
      <img src="path/to/bg/img.jpg">
    <div>
    <div id="content">
       All page content goes here
    </div>
 </body>
</html>
Oneway is offline
Reply With Quote
View Public Profile
 
Old 08-16-2006, 01:55 PM Re: Background size help
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
You don't want to us position: absolute. For one it's not necessary, and 2 it can cause many other problems.

You set the bg to 'no-repeat', so, of course, it's not going to. It's a problem when you use a large single graphic for a background. Either make the bg so that you can tile it and re-think the other elements (the needle etc) and place them independently, or make the background itself much wider and longer. I would do the former, as making the bg image bigger will up your page weight considerably.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Background size help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45337 seconds with 12 queries