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!
freeze background
Goto page Previous  1, 2, 3  Next
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML
View previous topic :: View next topic  
Author Message
GannMan



Joined: 03 Apr 2007
Posts: 1

PostPosted: Tue Apr 03, 2007 2:33 am     Reply with quote

hey i registered to post that i was also having problems with it aligning to the top left, heres what worked for me best. thanks for all your help.

Code:
<style type="text/css">
body
{
background-image: url("some image.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position:center
}
</style>
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Tue Apr 03, 2007 3:41 am     Reply with quote

Using the CSS shorthand might be better as well. Since CSS is cascading, some browsers will wipe out the image if they see a background color. And a color should be used just in case people cannot download images / or choose not to download images.

_________________
Corey
Toll Free Fax Numbers | Mile High Merchant Accounts
Keikura



Joined: 24 Mar 2007
Posts: 167
Location: U.K.

PostPosted: Tue Apr 03, 2007 11:18 am     Reply with quote

The cascade effect will only work if he sets the background-color attribute for the body later on.

Currently there is no chance of it being overridden.

Plus shorthand is not always best especially when you have a lot of values set and its easier to read than it being all on one line.

Things like border's can be one line if they're the same all round. E.g.

Code:

border: 1px solid #000000;

/* then you can override say the bottom border rather than set all four border' individually */
border-bottom:3px solid #FF9966;
celeste



Joined: 19 May 2007
Posts: 2

PostPosted: Sat May 19, 2007 12:59 pm     2 backgrounds Reply with quote

so what im trying to do is put a main background that repeats and then a 2nd image in the middle of the background but all as a background? im so confused. i need a code that helps im kin a new to all this
celeste



Joined: 19 May 2007
Posts: 2

PostPosted: Sat May 19, 2007 1:00 pm     2 backgrounds Reply with quote

so what im trying to do is put a main background that repeats and then a 2nd image in the middle of the background but all as a background? im so confused. i need a code that helps im kin a new to all this im trying to do this for a journal thats called blurty
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Sat May 19, 2007 1:15 pm     Reply with quote

Consider using a background image in the <body> and one in a <div> or table / cell.

_________________
Corey
Toll Free Fax Numbers | Merchant Accounts | Microsoft Expressions
Keikura



Joined: 24 Mar 2007
Posts: 167
Location: U.K.

PostPosted: Sat Sep 08, 2007 10:18 am     Reply with quote

Or more simply:

Code:
div.bga {
    background-image:url(path/to/image1.jpg);
    width:500px;
    height:500px;
}

div.bgb {
    background-image:url(path/to/image2.jpg);
    width:250px;
    height:250px;
}

. . . . .

<div class="bga" align="center">
    <div> class="bgb"> . . . </div>
</div>
Attilapele



Joined: 02 Feb 2008
Posts: 2

PostPosted: Sat Feb 02, 2008 12:58 pm     hey :) Reply with quote

i need a little help here...i'm a beginer so...
i want to center my background and don't reply.
but i want that i could scroll down until the end of my background picture, then end of my background pic...how can i make that?
please help!
thx
Attilapele



Joined: 02 Feb 2008
Posts: 2

PostPosted: Sat Feb 02, 2008 1:02 pm     Reply with quote

so don't be fixed...just in the center of the monitor and don't be repeated
spaige08



Joined: 08 Feb 2008
Posts: 4

PostPosted: Fri Feb 08, 2008 10:15 am     Tried HTML & CSS coding to freeze and not repeat backgro Reply with quote

Okay, I read thru the thread and tried every coding suggested and either my background image is tiled (with the HTML coding) or it doesn't appear at all with the CSS coding. I am copying everything and all I get is a white background instead of the image... what am I doing wrong?
Corey Bryant
Site Admin


Joined: 15 May 2004
Posts: 8749
Location: Castle Pines North, CO USA

PostPosted: Fri Feb 08, 2008 10:17 am     Reply with quote

It is very difficult to say unfortunately. Please post what code you are using and that will help us to help you.

_________________
Corey
Toll Free Fax Solutions | Mile High Merchant Accounts | Expression Web Blog
spaige08



Joined: 08 Feb 2008
Posts: 4

PostPosted: Fri Feb 08, 2008 10:33 am     Here is my code Reply with quote

Maybe I am placing it in the wrong spot...

I have my title and the metatags and then:

<style type="text/css">
body
{body-background:"http://www.stephenlasararchitects.com/nancylasar/Westover 031.jpg";
background-repeat:no-repeat
background-position:center;
background-attachment:fixed}
</style>
<table border=1 width=600px cellpadding=0 cellspacing=0 align=center>
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Fri Feb 08, 2008 11:24 am     Reply with quote

Replace body-background with background-image

body-background isn't a CSS instruction.

Hope this helps!
spaige08



Joined: 08 Feb 2008
Posts: 4

PostPosted: Fri Feb 08, 2008 12:25 pm     Thank you Reply with quote

I finally got it to work... now that I know what to do I am going to play around with the image since I want text above it to be read.

Last Question... do you think a vertical image works better then a horizontal? Square image? I am trying to consider all monitor types. Thanks!
madprof



Joined: 26 Jan 2008
Posts: 98

PostPosted: Fri Feb 08, 2008 12:34 pm     Reply with quote

Unobtrusive, stylish, easy to read text over etc.
If it fits those then few people will care if it is portrait or landscape. Smile
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> General HTML All times are GMT - 8 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

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