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 11-19-2004, 08:36 PM Layout Help
Novice Talker

Posts: 10
Trades: 0
I am using a background image on a page on my site which I do not want to repeat. However doing this leaves scrappy white areas where there is no data. I would like to be able to centre the entire page so there is even ammouts of white either side of my page and so that when you adjust the window size on the display the whole page remains in the centre.

the best example of this i can find is the guardian page www.guardian.co.uk

I can get the background image to do this but the text and images remain in position and the page ends up looking stupid.

Can anyone give me some advice? Sorry if i haven't exmplained myself very well

Cheers in advance
danielbower is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2004, 08:42 PM
vivekar's Avatar
Webmaster Talker

Posts: 612
Trades: 0
You can try using CSS.

body{
text-align: center;
}

Post your URL for any further info.
__________________

Please login or register to view this content. Registration is FREE
(Active since 2003) |
Please login or register to view this content. Registration is FREE
vivekar is offline
Reply With Quote
View Public Profile Visit vivekar's homepage!
 
Old 11-19-2004, 09:18 PM Sort of
Novice Talker

Posts: 10
Trades: 0
that is along the right lines but then all my text will be aligned centrally what if I was to align it to the right or left?

Here is what I have so far: it's not a real page just a test I'm working on.

www.youngineurope.com/centre.htm


The images still have the same problem as you can see. If you adjust the size of your window they don't move relatively to the rest of the page.
danielbower is offline
Reply With Quote
View Public Profile
 
Old 11-19-2004, 09:41 PM
faze1's Avatar
Ultra Talker

Posts: 389
Trades: 0
Hello,


For background images Artic Fox provided a link in this thread that is really slick.

Vivekar's advice is perfect for what you are asking but to answer your question about the text you could create a another rule. Below is an example from one of my sites.
Code:
body {
 background: #fff url('bg.gif') no-repeat scroll 50% 50%;
 font: 12px Verdana, Arial, Helvetica, sans-serif; color: #000080; 
 margin: 0 0 10px;
 padding: 0;
 text-align: center;
}
#container {
 border: 1px inset #000;
 width: 750px;
 margin: 0 auto;
 padding: 0;
 text-align: left;
}
On this page I added <div id="container"> immediatley after the body which conatins the entire page. I'm sure there are many ways to accomplish your goal, this one just happened to work for me.

Good luck,
__________________
[size=2]
Please login or register to view this content. Registration is FREE
- Webhosting - Focusing on quality service

Last edited by faze1; 11-19-2004 at 09:49 PM..
faze1 is offline
Reply With Quote
View Public Profile Visit faze1's homepage!
 
Old 11-20-2004, 07:29 AM cheers
Novice Talker

Posts: 10
Trades: 0
i'm we'll on my way now

thanks for the help
danielbower is offline
Reply With Quote
View Public Profile
 
Old 11-20-2004, 08:10 AM
Average Talker

Posts: 17
Trades: 0
You could also put everything in one giant table and center the table.

<CENTER>
<TABLE cellpadding="0" cellspacing="0" border="0" width="80%">
<TR>
<TD>
All your content
</TD>
</TR>
</TABLE>
</CENTER>

Hope I helped
LemmonLime is offline
Reply With Quote
View Public Profile Visit LemmonLime's homepage!
 
Old 11-22-2004, 12:51 AM hi
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
For some strange reason when I use <P> tags I can adjust the text alignment on each paragraph. I think it is <p align="right, left, centre, justified...">then you text.</P>
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 11-23-2004, 11:31 AM
Novice Talker

Posts: 10
Trades: 0
cheers

i think the table idea could be the way forward. thanks for the help.
danielbower is offline
Reply With Quote
View Public Profile
 
Old 11-23-2004, 01:24 PM
NateDogg's Avatar
Extreme Talker

Posts: 163
Trades: 0
Using DIV's and CSS is the best way because it is more flexible and is the web standard. If you use the CSS code:
Code:
body
{
   background-image: url(image.jpg);
   background-position:top center;
}
This solves the centering problem and does not include difficult to manage tables.

For more info check http://www.w3schools.com/css/css_ref...asp#background
it's a great resource
__________________
Nathan


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
NateDogg is offline
Reply With Quote
View Public Profile
 
Old 11-26-2004, 09:55 PM
Novice Talker

Posts: 10
Trades: 0
but the text doesn't realign along with the image.

My background image stays in the center but the text doesn't

Dan
danielbower is offline
Reply With Quote
View Public Profile
 
Old 11-26-2004, 10:01 PM
faze1's Avatar
Ultra Talker

Posts: 389
Trades: 0
Hey Dan,

Try inserting my css I added earlier in the thread, it is exactly what you are looking for for the content alignment, although a few tweaks might be needed. If you want to try it but are unsure how to implement it, please post here and I will work it in for you. It is alot easier than you might think.

Cheers,
__________________
[size=2]
Please login or register to view this content. Registration is FREE
- Webhosting - Focusing on quality service
faze1 is offline
Reply With Quote
View Public Profile Visit faze1's homepage!
 
Old 11-26-2004, 10:17 PM
Snowblind's Avatar
Skilled Talker

Posts: 80
Location: New Zealand
Trades: 0
Code:
<CENTER>
<TABLE cellpadding="0" cellspacing="0" border="0" width="80%">
<TR>
<TD>
All your content
</TD>
</TR>
</TABLE>
</CENTER>
The problem with wrapping all your content in a table is that anything within a table does not show until it is fully loaded. A lot of viewers will see no progress in loading the site and decide to go somewhere else. If it is not wrapped in a table the user can see progress and will be more likely to wait.
__________________
Snowblind \m/

Please login or register to view this content. Registration is FREE
Snowblind is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Layout 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 5.08782 seconds with 12 queries