Removing white space from right & buttom

This is a discussion on "Removing white space from right & buttom" within the Web Page Design section. This forum, and the thread "Removing white space from right & buttom are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 31st, 2007, 13:46
New Member
Join Date: Oct 2007
Location: Toronto
Age: 28
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Removing white space from right & buttom

Hello, I'm going out of my mind on this for days, after reading Web Forumz FAQ and coming across this:

How do I get rid of the space on the top and left of the browser window?
html, body {
margin: 0;
padding: 0;
}


I have done that, and yet my image still does not touch the right or buttom of the browser window, it touches the top and left perfectly. I've even played around with making the image bigger in hopes and nothing just scrolling I get. It's a background image in a style and it's in a <div>

I hope someone can help me with this ?

Also

Can you not apply a link to a style or a layer or both (link as to another page or external link to a page outside your web page?)
Reply With Quote

  #2 (permalink)  
Old Oct 31st, 2007, 13:51
alexgeek's Avatar
Administrator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,769
Blog Entries: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alexgeek
Re: Removing white space from right & buttom

try
Code: Select all
* {margin: 0; padding: 0;}
instead
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Reply With Quote
  #3 (permalink)  
Old Oct 31st, 2007, 13:53
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 405
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: Removing white space from right & buttom

use this code

Code: Select all
<style type="text/css">
<!--
body {
    margin: 0px;
}
-->
</style>
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #4 (permalink)  
Old Oct 31st, 2007, 13:55
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

Quote:
Originally Posted by alexgeek View Post
try
Code: Select all
* {margin: 0; padding: 0;}
instead
No ... don't use the * unless you know it's implications!

No Margin For Error


Please provide a link so we can help you further.


Quote:
Originally Posted by marSoul View Post
use this code

Code: Select all
<style type="text/css">
<!--
body {
    margin: 0px;
}
-->
</style>
You're missing the padding: 0 in there for IE and you don't need the px. See Make your CSS efficient

Last edited by karinne; Oct 31st, 2007 at 13:57.
Reply With Quote
  #5 (permalink)  
Old Oct 31st, 2007, 15:03
New Member
Join Date: Oct 2007
Location: Toronto
Age: 28
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

This is my CSS for my background. How can I relate the code you gave into this style or is that put on the HTML level?

.background {
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
margin: 0px;
height: 100%;
width: 100%;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
background-repeat: no-repeat;
position: absolute;
overflow: visible;
background-image: url(../background.png);
background-position: left top;
padding: 0px;
z-index: 2;
visibility: visible;
}

<body>
<div class="background" id="style-background"></div>

This is the HTML, where does that code fit in ?
Reply With Quote
  #6 (permalink)  
Old Oct 31st, 2007, 15:06
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

Add this to your CSS

Code: Select all
html, body, div {
    margin: 0;
    padding: 0;
}
Reply With Quote
  #7 (permalink)  
Old Oct 31st, 2007, 15:19
New Member
Join Date: Oct 2007
Location: Toronto
Age: 28
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

I added that code, nothing has changed what I added is in bold (as seen below my style code)

.background {
margin: 0px;
padding: 0px;

border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
margin: 0px;
height: 100%;
width: 100%;
left: 0px;
top: 0px;
right: 0px;
bottom: 0px;
background-repeat: no-repeat;
position: absolute;
overflow: visible;
background-image: url(../background.png);
background-position: left top;
padding: 0px;
z-index: 2;
visibility: visible;
}
Reply With Quote
  #8 (permalink)  
Old Oct 31st, 2007, 15:21
karinne's Avatar
SuperMember

SuperMember
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

Put this online so we can see ...
Reply With Quote
  #9 (permalink)  
Old Nov 1st, 2007, 05:11
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Removing white space from right & buttom

You got it all wrong..
That code you gave us, is for the div style, not your body style, which you got the problem with the spaces.

HTML: Select all
html, body, div {
margin: 0;
padding: 0;
}
.background {
    bla bla bla..
}
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #10 (permalink)  
Old Nov 3rd, 2007, 15:37
New Member
Join Date: Oct 2007
Location: Toronto
Age: 28
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

moonie this code:

html, body, div {
margin: 0;
padding: 0;
}

goes ontop of my style ?

http://www.walkfar.ca/creativesheep_main_page2.html

this is the link you'll see the background does not fit the browser window at the buttom and right ? Also how come after uploading the css styles to the server the button on the right and left flick away ?

One last thing how can you apply a link to a style to link to another part of your page or another web page ?
Reply With Quote
  #11 (permalink)  
Old Nov 5th, 2007, 02:51
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Removing white space from right & buttom

Yup, that code goes on the top of your CSS style!

How come you got so many css embeded style in your page?
There is also some external style...? It's confusing...

Quote:
...how can you apply a link to a style to link to another part of your page or another web page ?
If you want all your page to use the same CSS Style, just put this line in your <head> and point that link to your CSS file (YourCSSstyle.css)

<link rel="stylesheet" type="text/css" href="YourCSSstyle.css" />
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
  #12 (permalink)  
Old Nov 5th, 2007, 15:49
New Member
Join Date: Oct 2007
Location: Toronto
Age: 28
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Removing white space from right & buttom

That did align the image perfectly to the browser left and top. Although what am I exactly after is this:


http://www.cssplay.co.uk/layouts/background.html

You'll notice that you can resize the browser window and so does the background image.

Also what I meant by linking is, how can I apply a link to another part of my page or a outside web page on a style sheet or layer ?
Reply With Quote
  #13 (permalink)  
Old Nov 5th, 2007, 19:45
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,649
Thanks: 0
Thanked 8 Times in 8 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
Re: Removing white space from right & buttom

Have you tried this for your resizing background image?

CSS:
Code: Select all
html, body {width:100%; height:100%; overflow:auto;}
#background{position:absolute; z-index:1; width:100%; height:100%;}
#scroller {position:absolute; width:100%; height:100%; top:0; left:0; overflow:auto; z-index:2;}
HTML

HTML: Select all
<html><body><div><img id="background" src="rabbit.jpg" alt="" title="" /><div id="scroller"><!-- Keeps the background image fixed --><!--  content here --></div> </body></html>
I am only trying to use the code that Stu Nicholls is using... Not 100% sure it will work! Hope this helps! (Not sure about other question..)
Reply With Quote
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ie6 white space under div AndrewChip Web Page Design 1 Jun 11th, 2008 13:15
Add white space using RegEx Access JavaScript Forum 2 Feb 8th, 2008 03:30
Big white space mikemay123 Web Page Design 5 Nov 6th, 2007 00:30
Removing the White Box around an image in Dreamweaver... kidflavor Graphics and 3D 3 Feb 6th, 2007 22:38
white space at top of page mdb01 Web Page Design 2 Nov 26th, 2006 21:39


All times are GMT. The time now is 05:53.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43