Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-05-2012, 05:36 AM   PM User | #1
flight567
New Coder

 
Join Date: Mar 2012
Posts: 23
Thanks: 2
Thanked 0 Times in 0 Posts
flight567 is an unknown quantity at this point
max-height not working?

ok i may have done something a bit wrong here... but i'm not sure i don't think i did.... so here's the problem. i'm working on my a website for my buddy, and for his opening page, i've made a picture with blurred edges and that jazz. that's all well and good so the problem comes when i set it to size. i can't keep it from having white space at the top and right side...
Code:
body{background-image:url("bg.jpg");
background-repeat:no-repeat;
-moz-background-size:1250px, 150%; 
background-size:1250, 150%;
}
anything especially wrong with that?
thanks all!
flight567 is offline   Reply With Quote
Old 05-05-2012, 05:44 AM   PM User | #2
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
you cannot set the size for a background. And neither can you scale it.

You can set the size for the element that have the background, and set alignment or distance from edges of the element. and if it should repeat or not

e.g.
Code:
body{background-image:url("bg.jpg");
background-repeat:no-repeat;
background-postion:top center;
}
Lerura is offline   Reply With Quote
Old 05-05-2012, 05:48 AM   PM User | #3
flight567
New Coder

 
Join Date: Mar 2012
Posts: 23
Thanks: 2
Thanked 0 Times in 0 Posts
flight567 is an unknown quantity at this point
really? i thought it was a new css3 thing..
http://www.w3schools.com/css3/css3_backgrounds.asp (if could look at this and tell me if i HAVE made a mistake lol. thanks)

thanks for your quick reply

i think i misunderstood. in that you can't set the bg size for the body. unfortunetly i've got it now that it's short enough but i'vestill got space on the side, no matter how long i set it to be.

Last edited by flight567; 05-05-2012 at 05:50 AM..
flight567 is offline   Reply With Quote
Old 05-05-2012, 05:55 AM   PM User | #4
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
Well! I wasn't aware of this new property! Now I am!

But you need to specify some units, and you must remove the comma in the value.

Code:
body{background-image:url("bg.jpg");
background-repeat:no-repeat;
-moz-background-size:1250px 150%; 
background-size:1250px 150%;
}
Lerura is offline   Reply With Quote
Old 05-05-2012, 05:58 AM   PM User | #5
flight567
New Coder

 
Join Date: Mar 2012
Posts: 23
Thanks: 2
Thanked 0 Times in 0 Posts
flight567 is an unknown quantity at this point
ok, i'll try it. thanks!
yea, the new properties are cool lol. it's my first time using html5 and css3 in the same document lols. can you explain to me exactly what <header> or<footer> does for you? it doesn't really seem to do anything.... just saying.
flight567 is offline   Reply With Quote
Old 05-05-2012, 06:12 AM   PM User | #6
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
The header and footer tags are not supposed to do anything.

They are to define that the content are either introductory to the document (header), or author information (footer), and are typically placed in top or bottom of the document respectively
Lerura is offline   Reply With Quote
Old 05-05-2012, 06:13 AM   PM User | #7
flight567
New Coder

 
Join Date: Mar 2012
Posts: 23
Thanks: 2
Thanked 0 Times in 0 Posts
flight567 is an unknown quantity at this point
so after some experimentation, i've determined that it's the margin-bottom attrib later down, to vertically center some textis what's screwing me up...however i've fixed it! (px is wonderful!) so my question is, should i put the text ontop of the image or "in" it?
so they are just organizational tags?

Last edited by flight567; 05-05-2012 at 06:17 AM..
flight567 is offline   Reply With Quote
Old 05-05-2012, 06:18 AM   PM User | #8
Lerura
Regular Coder

 
Lerura's Avatar
 
Join Date: Aug 2005
Location: Denmark
Posts: 869
Thanks: 0
Thanked 112 Times in 111 Posts
Lerura will become famous soon enough
margin bottom is not for centering content.
It is to push the tag and it content away from the edges of the parent or sibling tags.
Lerura is offline   Reply With Quote
Old 05-05-2012, 06:19 AM   PM User | #9
flight567
New Coder

 
Join Date: Mar 2012
Posts: 23
Thanks: 2
Thanked 0 Times in 0 Posts
flight567 is an unknown quantity at this point
that explains why it did that. lol
flight567 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 07:22 PM.


Advertisement
Log in to turn off these ads.