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.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
My background image is repeating and i don't know why
Old 10-24-2010, 08:52 PM My background image is repeating and i don't know why
Novice Talker

Posts: 7
Name: Brandon
Trades: 0
Here is my whole entire code. This isn't going to be a real website, this is just a school project, but i really need the repeating background image to stop repeating. If you would like the .rar file so you can see the whole page with the image then please ask.




HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Brandon's Super Awesome Website</title>

<style type="text/css">


html {height:100%;}
body {height:100%; margin:0; padding:0;}

#bg
{
position:fixed; top:0; left:0; width:100%; height:100%;
}

#content {position:relative; z-index:1;}



body {

	font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
	
	background-image:url(Winter.jpg);

	margin: 0;

	padding: 0;

	color: #000;

}

ul, ol, dl { 

	padding: 0;

	margin: 0;

}

h1, h2, h3, h4, h5, h6, p {

	margin-top: 0;

	padding-right: 15px;

	padding-left: 15px; 

}

a img { 

	border: none;

}



a:link {

	color: #42413C;

	text-decoration: underline; 

}

a:visited {

	color: #6E6C64;

	text-decoration: underline;

}

a:hover, a:active, a:focus { 

	text-decoration: none;

}





.container {
	width: 960px;
    margin:auto; 
}





.header {

	background: #ADB96E;

	border:groove;

	border-color:#F00;



}



.sidebar1 {

	float: left;

	width: 180px;

	background: #EADCAE;

	margin-top: 20px;

	margin-bottom: 150px;

	border:groove;

	border-color:#F00;

}

.content {

	background-color:#390;

	padding: 10px 0;

	width: 600px;

	float: left;

	margin-top: 50px;

	margin-left: 80px;

	margin-bottom: 200px;

	border:groove;

	border-color:#F00

}



.content ul, .content ol { 

	padding: 0 15px 15px 40px; 

}





ul.nav {

	list-style: none; 

	border-top: 1px solid #666; 

	margin-bottom: 15px; 

}

ul.nav li {

	border-bottom: 1px solid #666; 

}

ul.nav a, ul.nav a:visited { 

	padding: 5px 5px 5px 15px;

	display: block; 

	width: 160px; 

	text-decoration: none;

	background: #C6D580;

}

ul.nav a:hover, ul.nav a:active, ul.nav a:focus { 

	background: #ADB96E;

	color: #FFF;

}







.fltrt {  

	float: right;

	margin-left:8px;

}

.fltlft {

	float: left;

	margin-right:8px;

}

.clearfloat { 

	clear:both;

	height:0;

	font-size: 1px;

	line-height: 0px;

}

.footer {

	padding: 10px 0;

	background: #CCC49F;

	margin-top: 100px;

	position: relative;

	clear: both;

	border:groove; 

	border-color:#F00;

}





</style></head>



<body>



<div class="container">

  <div class="header">

   <center><h1>Brandon's Super Awesome Perfect Website</h1></center>

  <a href="#"><a href="#"></a></div>

  <div class="sidebar1">

    <ul class="nav">

      <li><a href="Home.html">Home</a></li>

      <li><a href="Aboutme.html">About</a></li>

      <li><a href="Photos.html">Photos</a></li>

      <li><a href="Contact.html">Contact</a></li></ul>

</div>

  <div class="content">

   <center><h1> Contact Me</h1></center>

    <p>Home Phone : (604)-872-3003</p>

    <p>Cell Phone : (604)-392-9222</p>

    <p>Email : [email]Brandon_Waugh5@hotmail.com[/email]</p>

    <p>Facebook : Brandon Waugh or <a href="http://www.facebook.com/profile.php?id=846505044">http://www.facebook.com/profile.php?id=846505044</a></p>

<h2></h2>

  </div>

    

    <div class="footer">

    

   <center> <p> &copy;2010 Brandon waugh</p></center>

    </div>

</div>

</div>

</body>

</html>

Last edited by chrishirst; 10-26-2010 at 04:21 PM..
brandonwaugh is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-25-2010, 12:48 AM Re: My background image is repeating and i don't know why
Super Moderator

Posts: 1,584
Location: Kokkola, Finland
Trades: 1
in the body declaration put this
background-repeat: no-repeat;
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 10-25-2010, 05:24 AM Re: My background image is repeating and i don't know why
Banned

Posts: 408
Name: mushget
Trades: 0
body
{
background-image:url('Winter.jpg');
background-repeat:no-repeat;
}
mushget is offline
Reply With Quote
View Public Profile Visit mushget's homepage!
 
Old 10-25-2010, 10:12 AM Re: My background image is repeating and i don't know why
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Or, using css shorthand: background: url(image.jpg) no-repeat;
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-25-2010, 10:05 PM Re: My background image is repeating and i don't know why
Novice Talker

Posts: 7
Name: Brandon
Trades: 0
That sort of helped, but altogether there are like 4 repeats, and it only got rid of on of them. :S
brandonwaugh is offline
Reply With Quote
View Public Profile
 
Old 10-26-2010, 03:56 AM Re: My background image is repeating and i don't know why
Banned

Posts: 36
Name: flemming
Trades: 0
Thanks for resolving the issue.The same issue was on my website.
flemming is offline
Reply With Quote
View Public Profile
 
Old 10-26-2010, 08:37 AM Re: My background image is repeating and i don't know why
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Well, you'd have to apply the same rules to any element where you do NOT want the background to repeat.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-26-2010, 12:57 PM Re: My background image is repeating and i don't know why
CSM
CSM's Avatar
Front-End Developer

Posts: 297
Name: Michael Pehl
Location: Palma de Mallorca
Trades: 0
Here is a demo from me where I use full size background (does not matter how your resolution is, background is always 100%).

http://xhtml-valid-websites.com/foru...ery-navigation
__________________
Chief Web Officer / Front-End Developer / System Engineer

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
CSM is offline
Reply With Quote
View Public Profile Visit CSM's homepage!
 
Old 10-26-2010, 06:01 PM Re: My background image is repeating and i don't know why
Novice Talker

Posts: 7
Name: Brandon
Trades: 0
But shouldnt there be no repeats at all? I did make the background 100%, so it should be the whole screen without a repeat right? Is there a mistake in there somewhere stopping it from being 100%?
brandonwaugh is offline
Reply With Quote
View Public Profile
 
Old 10-27-2010, 09:16 PM Re: My background image is repeating and i don't know why
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
I did make the background 100%
You made the background DIV 100%, not the background IMAGE.
The width:100% isn't even necessary, that's the default behavior unless you give it some other dimension.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Last edited by LadynRed; 10-28-2010 at 09:25 AM..
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 10-27-2010, 10:45 PM Re: My background image is repeating and i don't know why
Novice Talker

Posts: 7
Name: Brandon
Trades: 0
oh ok thanks!
brandonwaugh is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to My background image is repeating and i don't know why
 

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 0.90152 seconds with 12 queries