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
2 header background colors...
Old 01-27-2007, 06:49 PM 2 header background colors...
Experienced Talker

Posts: 36
Trades: 0
I'm used to coding with tables but I'm trying to learn to code tableless as it's becoming the new standard... Anyway...

I've gotten a design on my hands that I need to finish coding ASAP as they're waiting for it. So a fast response would be great!

I have a situation where the designer made a fixed width template and it has to be centered but 1 side of the header is a different color than the other side...

So I need a way to make a certain background image repeat 100% on the left and another one to repeat 100% on the right meanwhile keeping in mind that the center box is fixed width...

How would I go about doing this? Tableless Valid XHTML/CSS...
I attached an image with the basic structure to show ya what I mean...

-Thanks


----------------------------------
Attached Images
File Type: jpg design.jpg (43.1 KB, 5 views)

Last edited by Phaaze; 01-27-2007 at 07:44 PM..
Phaaze is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-27-2007, 07:13 PM Re: 2 header background colors...
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Code:
#header-left {
     float:  left;
     width:  200px; /* replace as appropriate */
     background-color:  #CC0000; /* also replace as appropriate */
     color:  inherit; /* you get the idea */
}
#header-right {
     float:  right;
     width:  580px; /* replace as appropriate */
     background-color:  #0000CC; /* also replace as appropriate */
     color:  inherit; /* you get the idea */
}
.clearing {
    clear:  both;
}
Then, for your HTML ....

Code:
<div id="header-left">...</div>
<div id="header-right">...</div>
<div class="clearing">...</div>
Basically, you just need to define two divs with different background colours (or images if you prefer.)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 01-27-2007, 07:33 PM Re: 2 header background colors...
Experienced Talker

Posts: 36
Trades: 0
Quote:
Originally Posted by ADAM Web Design View Post
Code:
#header-left {
     float:  left;
     width:  200px; /* replace as appropriate */
     background-color:  #CC0000; /* also replace as appropriate */
     color:  inherit; /* you get the idea */
}
#header-right {
     float:  right;
     width:  580px; /* replace as appropriate */
     background-color:  #0000CC; /* also replace as appropriate */
     color:  inherit; /* you get the idea */
}
.clearing {
    clear:  both;
}
Then, for your HTML ....

Code:
<div id="header-left">...</div>
<div id="header-right">...</div>
<div class="clearing">...</div>
Basically, you just need to define two divs with different background colours (or images if you prefer.)
I tried that and I just get the center div being displayed below the other 2...
Phaaze is offline
Reply With Quote
View Public Profile
 
Old 01-27-2007, 07:56 PM Re: 2 header background colors...
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
What center div? You have a logo and a right side navigation div.

On second thought, throw your code up somewhere. It might make more sense then.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 01-27-2007, 07:58 PM Re: 2 header background colors...
Experienced Talker

Posts: 36
Trades: 0
Quote:
Originally Posted by ADAM Web Design View Post
What center div? You have a logo and a right side navigation div.

On second thought, throw your code up somewhere. It might make more sense then.

After a little trial and error I finally managed to get it.
Code:
            <div id="header">
                <div id="header-left">
                    Left
                </div>
                <div id="header-right">
                    Right
                </div>
                <div id="header-center">
                    Center                
                </div>
            </div>
Code:
    #header-left
    {
        height: 67px;
        width: 45%;
        background-image: url(images/head_left.gif);
        background-repeat: repeat-x;
        float: left;
        margin: 0;
        padding: 0;
    }
    #header-center
    {
        height: 67px;
        width: 759px;
        margin: 0;
        padding: 0;
        z-index: 1;
    }
    #header-right
    {
        height: 67px;
        width: 45%;
        background-image: url(images/head_right.gif);
        background-repeat: repeat-x;
        float: right;
        margin: 0;
        padding: 0;
    }
Thanks again!

Last edited by Phaaze; 01-27-2007 at 07:59 PM..
Phaaze is offline
Reply With Quote
View Public Profile
 
Old 01-27-2007, 10:09 PM Re: 2 header background colors...
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
No offense, but why go thru all that ?? Use the ENTIRE bi-color header has a background for the header div, then float the logo and the menu where you want them ??
__________________
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 01-28-2007, 02:21 AM Re: 2 header background colors...
Experienced Talker

Posts: 36
Trades: 0
Quote:
Originally Posted by LadynRed View Post
No offense, but why go thru all that ?? Use the ENTIRE bi-color header has a background for the header div, then float the logo and the menu where you want them ??

Ok, well I ended up getting stuck on the tableless html and this guy does not care if it's tableless or not so I went back to using tables but I still cannot figure out how I can make it repeat properly on the header/footer...

--Link Removed--

(Open it in FF2 and you can see basically how it's supposed to be... But it won't work in anything else...)

I have not coded in awhile and don't know much about css so please be specific and show me an example as I'm more of a visual learner.

-Thanks

------------
Edit: Figured it out using tables, thanks anyway!

Last edited by Phaaze; 01-28-2007 at 05:05 AM..
Phaaze is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to 2 header background colors...
 

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.25462 seconds with 13 queries