HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
background alignment on body
Post new topic   Reply to topic    HTML Help Forum Index -> CSS
View previous topic :: View next topic  
Author Message
quartzy



Joined: 26 Dec 2007
Posts: 405

PostPosted: Mon Apr 28, 2008 1:41 pm     background alignment on body Reply with quote

I have an image that is 834px wide, the body is 800px wide so that should give me 17px on each side for the border to show, except it does not show correctly ie fit tightly to the body edges down two sides. Dont know how to center the image so it will fit exactly behind the body. Does anyone know?

Code:
body {
   font-family: Helvetica, Verdana, Arial, sans-serif;
   font-size: 0.88em;
   color: #FFFFFF;
   text-align: center;
   background: #000000 url('images/background.gif')repeat-y fixed;}
      
#container {
   width: 800px;
   height: 100%;
   margin: auto;
   text-align: left;
   border: 1px solid #625e00;}   
   


I have found out how to do it now, from a template I found.
Code:
repeat-y center top;
sticks464



Joined: 31 Dec 2006
Posts: 1171

PostPosted: Mon Apr 28, 2008 1:56 pm     Reply with quote

For centering with a centered fix layout change
background: #000000 url('images/background.gif')repeat-y fixed;}
to background: #000000 url('images/background.gif')repeat-y top center;} and it should work. You wouldn't need the fixed attribute unless you wanted the image to remain on the screen while the content scrolls.
quartzy



Joined: 26 Dec 2007
Posts: 405

PostPosted: Mon Apr 28, 2008 1:59 pm     re Reply with quote

hi guessed we posted at the same time, while I am here can you fit a class on a <br>? as it dont seem to work I have an image on the break too.
sticks464



Joined: 31 Dec 2006
Posts: 1171

PostPosted: Mon Apr 28, 2008 2:08 pm     Reply with quote

I've never tried to do a class on a <br>. But it shouldn't be any different than a class on the img tag.
Code:
br {
blah:...;
blah:...;
blah:...;
}
quartzy



Joined: 26 Dec 2007
Posts: 405

PostPosted: Mon Apr 28, 2008 2:38 pm     re Reply with quote

yes, I tried it but it does not work. Now I have to find a fix, as the centered border down the sides on the body does not show in IE7 and probaly IE6.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> CSS All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial