Can't get the content to stay with the background

This is a discussion on "Can't get the content to stay with the background" within the Web Page Design section. This forum, and the thread "Can't get the content to stay with the background 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 Aug 14th, 2007, 17:14
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Can't get the content to stay with the background

Hi, I'm having trouble getting my content to move with background. When ever I resize my window the background moves but not the content.
Attached Files
File Type: html home.html (2.4 KB, 13 views)
File Type: css style.css (3.5 KB, 9 views)
Reply With Quote

  #2 (permalink)  
Old Aug 14th, 2007, 17:23
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 719
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

Can ytou link to the page? I can't be bothered to downlaod the files
Reply With Quote
  #3 (permalink)  
Old Aug 14th, 2007, 17:28
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

Sure its http://detabeta.com/site/home.html.
Reply With Quote
  #4 (permalink)  
Old Aug 14th, 2007, 18:12
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 719
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

what is it supposed to look like?

ios the news bar suppsoed to be outside of the whole big square thing?
Reply With Quote
  #5 (permalink)  
Old Aug 14th, 2007, 18:15
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

I want it all too stay in the green border.
Reply With Quote
  #6 (permalink)  
Old Aug 14th, 2007, 18:23
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 719
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

Thats a lot fo code you've got there. You don't need all those divs and spans
and <br/> tags either.

You need a div around the whole thing, one around the links, one around the news and two more within the news for the top and bottom image, one for the footer.
Reply With Quote
  #7 (permalink)  
Old Aug 14th, 2007, 18:42
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 719
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

Right...i've made a template that you can work on if you like. Its just the basic layout fo your site,

i wouldn't overwrite what yov'e got but this is the way to do it. you have waaay to much code, also notice how my code is nicely laid out. I looked at yours and couldn't be bothered to start editing it.

So the html is:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
<html>
<head>
<link rel="stylesheet" type="text/css"
href="style.css"/>
</head>
 
 <body>
 
<!-- COMMENT: The container div keeps all of the content in it, and is used to keep it all centered in the page -->
 
<div id="container">
  
<!-- COMMENT:  Menu div for the menu -->
     <div id="menu">
        <a href="" title="Home">Home</a>
        <a href="aboutme.html" title="About Me">About Me</a>
        <a href="phonepod.html" title="Inventions">Inventions</a>
        <a href="animations.html" title="Animations">Animations</a>
        <a href="ups.html" title="UPS">UPS</a>
        <a href="3rdgen.html" title="iPod Collection">iPod Collection</a>
        <a href="videos.html" title="Videos">Videos</a>
        <a href=".html" title="Forum">Forum</a>
    </div>

 <!-- COMMENT: Heading div will contain all info for the heade - if there is a logo you can set this as the bg image -->    
    <div id="heading">
        <h2>Welcome</h2>
    </div>

 <!-- COMMENT: All other content -->
    <div id="content">
        <p>Welcome to DetaBeta here you can find out more about me also you can view my photos and animation, I hope enjoy your looking at my website.</p>
    
        <p>I created this website so that others could see my work and web skills and I hope to improve my website as a go along. Well I hope you enjoy the layout of my website.</p>
    </div>
    
 <!-- COMMENT: news creates a sidebar for the news -->    
    <div id="news">
        <div class="newsHead">
            <h2>News</h2>
        </div>
        <p>7 August 2007</p>
        <p>Made the navigation buttons smaller also added the Videos section. Also I have changed all the text to Futura.</p>

        <p>24 July 2007</p>
        <p>Updated the Photos section.</p>

        <p>23 July 2007</p>
        <p>Added a header to each page and widened the pages to 850 pixels.</p>

        <p>20 July 2007</p>
        <p>I updated the layout a bit also added <a href="ups.html">UPS</a>.</p>
        <div class="newsBottom"></div>
    </div>


 <!-- COMMENT: footer - used for the footer and to clear both floats -->
    <div id="footer">
    Footer
    </div>

</div>
</body>
</html>
and the CSS:

Code: Select all
/*container has a set width of 850px, it is centered and has a border and padding of 1em to keep the content from the edges */

#container    {
    width: 850px;
    margin: 0px auto;
    border: 1px solid #000;
    padding: 1em;
}

/* news sidebar has a set width of 201px */
#news    {
    width: 201px;
    border: 1px solid #000;
    margin: 1em;
}

/* the content is floated around the sidebar */
#content    {
    float: right;
    width: 600px;
}

#menu    {
    width: 100%;
    border: 1px solid #000;
}

/*the footer is used to clear the float of the content, this keeps it all within the container */
#footer    {
    width: 100%;
    border: 1px solid #000;
    clear: both;
}
All this is is a white page witha few borders showing how itys laid out.

It is a fixed with layout so it will not stretch siodeways, but will stretch downwards...

For your layout the curves on your container will need to be seperate images, so you will have one at the top as a background which has the top curves, then a repeating image which will just be the green border - if you line it up properly with the images then you can prob just use a css border, and then a bottom image which will ahve the bottom two curves.

its a similar thing with the sidebar, again you'll ahve to add a couple of divs in there possibly. and chop your image into three bits.

The problem with it is at the moment is as soon as your content is bigger than the image it will move out the image, with a repeating image it can stretch downwards.
Reply With Quote
  #8 (permalink)  
Old Aug 14th, 2007, 18:58
Up'n'Coming Member
Join Date: Jul 2007
Location: Glasgow
Age: 15
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

Thanks for the help you done so much for me I wish I could repay you.
Reply With Quote
  #9 (permalink)  
Old Aug 14th, 2007, 19:18
1840dsgn's Avatar
SuperMember

SuperMember
Join Date: Jun 2007
Location: Canterbury
Age: 19
Posts: 719
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Can't get the content to stay with the background

No problems.

hope you get on ok with it.

Once you've given it a go if you've still got any problems just as and we'll give you a hand.
Reply With Quote
Reply

Tags
content, background

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
stay at home mom sunrise1964 Introduce Yourself 9 Jun 17th, 2008 19:24
Fading the content div into the body background-image? lmc148 Web Page Design 5 Jan 16th, 2008 05:22
Problem with css content box made from divs and background images weasel Web Page Design 3 Aug 9th, 2007 22:48
Seems to be satndard so I'll stay with it grandman Introduce Yourself 14 Jun 10th, 2007 21:58
Crazy Background stay scroller help.. NSF Web Page Design 4 Jun 14th, 2005 21:13


All times are GMT. The time now is 07:09.


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