GetDotted Domains

Viewing Thread:
"Argh! Css and Div tag headache..."

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Sat 11/06/05 at 17:45
Regular
"Unretired"
Posts: 890
I've never actually used Div + Css in my page layouts before so please excuse my ignorance towards the subject.

Basically I want a header image on the top of the page that expands with different browser widths.

The header consists of 3 images that I want in this order.
On the left is the image with the site logo.
In the middle is an expandable 100% width image.
On the Right is an extra image to give the header a nice rounded look.

Currently I have this:






Css:
.header {
background-image: url("Images/headermid.jpg");
width: 100%;
height: 52px;
z-index: 1;
position:absolute;
}

.header-image-left {
background-image: url("Images/headerleft.jpg");
width: 277px;
height: 50px;
z-index: 2;
}

.header-image-right {
background-image: url("Images/headerright.jpg");
width: 8px;
height: 50px;
z-index: 2;
}


Now the header displays fine, apart from the headerright image appears beneath the header, instead of aligned to the right.

I've tried everything I can think of.. Adding position and align code, moving the headerright div outside of the original header tag, even tried adding a middle filler image to force the image to the right.

Thanks in advance to anyone that can help.
Tue 21/06/05 at 19:38
Regular
Posts: 4,279
What exactly are you trying to do?
Tue 21/06/05 at 19:38
Regular
"Unretired"
Posts: 890
Aww damn...
There a certain elements that must be pixel perfect in size..
Think I might scrap Div's for tables instead then, or try using both.
Tue 21/06/05 at 19:32
Regular
Posts: 4,279
Theres no direct way around this. When something is declared as 100% it doesnt expand to 100% of the space available. It gets the width of the browser screen and sets it to that.

Therefore say your browser width is 1000px it will take 100% as a 1000px.

So if you add to this a 200px wide menu, the total will be 1200px so therefore you will get this scroll.

If you are going to do this everything must be done using percentages.
Tue 21/06/05 at 19:24
Regular
"Unretired"
Posts: 890
Malaktix wrote:
> Ok then, is there any way I can set the width of a div tag to 100% of
> the space available not the whole screen.
>
> What I mean is, when I set width to 100%, the Div tag expands to the
> size of 100% of the screen, even if some of that 100% has already
> been used by other Div tags. Which means that you have to scroll
> horizontally to see the whole page.


BUMP! Someone here must have an answer.
Mon 13/06/05 at 19:15
Regular
"Unretired"
Posts: 890
Ok then, is there any way I can set the width of a div tag to 100% of the space available not the whole screen.

What I mean is, when I set width to 100%, the Div tag expands to the size of 100% of the screen, even if some of that 100% has already been used by other Div tags. Which means that you have to scroll horizontally to see the whole page.
Sun 12/06/05 at 18:05
Regular
"Unretired"
Posts: 890
Coin wrote:
> Heh.
>
> Remmember the "Clear" selector. After floated DIVs, use the
> clear selector to place another div below it.
>
> (Especially useful for footers.)

Mate your a genius, I just came here to ask a question you just answered!
Cheers.
Sun 12/06/05 at 12:19
Regular
"Bicycle"
Posts: 4,899
Heh.

Remmember the "Clear" selector. After floated DIVs, use the clear selector to place another div below it.

(Especially useful for footers.)
Sat 11/06/05 at 18:02
Regular
"Unretired"
Posts: 890
Aha!

Discovered the use of "float", and all is good.
I will probably encounter more problems so expect more questions in this topic.
Sat 11/06/05 at 17:45
Regular
"Unretired"
Posts: 890
I've never actually used Div + Css in my page layouts before so please excuse my ignorance towards the subject.

Basically I want a header image on the top of the page that expands with different browser widths.

The header consists of 3 images that I want in this order.
On the left is the image with the site logo.
In the middle is an expandable 100% width image.
On the Right is an extra image to give the header a nice rounded look.

Currently I have this:






Css:
.header {
background-image: url("Images/headermid.jpg");
width: 100%;
height: 52px;
z-index: 1;
position:absolute;
}

.header-image-left {
background-image: url("Images/headerleft.jpg");
width: 277px;
height: 50px;
z-index: 2;
}

.header-image-right {
background-image: url("Images/headerright.jpg");
width: 8px;
height: 50px;
z-index: 2;
}


Now the header displays fine, apart from the headerright image appears beneath the header, instead of aligned to the right.

I've tried everything I can think of.. Adding position and align code, moving the headerright div outside of the original header tag, even tried adding a middle filler image to force the image to the right.

Thanks in advance to anyone that can help.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Simple, yet effective...
This is perfect, so simple yet effective, couldnt believe that I could build a web site, have alrealdy recommended you to friends. Brilliant.
Con
My website looks tremendous!
Fantastic site, easy to follow, simple guides... impressed with whole package. My website looks tremendous. You don't need to be a rocket scientist to set this up, Freeola helps you step-by-step.
Susan

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre
Feedback Close Feedback

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.