472,805 Members | 915 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Simple positioning problem

Hey there.

My name is Rowan, and it's been three weeks since I last used tables
for an HTML design.

Okay, I'm rather new to CSS and I have a big positioning problem here.
It might not be a really huge problem, but I've been fighting it for
days, and have received no help so far. Have a look at this (try it
out in IE and Firefox please) http://www.discoverourmusic.com/rowan/css/home.html
- The problem's with the fairy at the top. On firefox (at least, my
firefox 1.5.0.11) the fairy is blocking horizontal space and the text
(which in the page provided is actually "test") is shifted slightly to
the right and isn't centered. Which I don't want. If you try it out on
IE, it's even worse. I have IE 6.0 and there's a vertical space
between my fairy and the beginning of the page.

Why?

Now if you manage to figure out why it's all happening and you have
some magic css command (e.g. -ie-piss-off: none;), please let me know
about it. I just want the fairy picture to exist without taking any
physical space. Is that even possible? Does that have something to do
with the display: block; thing? I tired that, and it didn't work
either.

Also, here's how the top part of my template should look like:
http://www.discoverourmusic.com/rowan/css/whatineed.jpg - You'll
notice a sunflower (http://www.discoverourmusic.com/rowan/css/
sunflower.png) behind the right side of the header. How can I place
the sunflower behind the header? Using z-index? That didn't work
either...

Can anyone help?
Rowy
(a member of Table Anonymous)

Apr 29 '07 #1
2 1883
On 2007-04-29, TheCruelPanda <Ro*********@gmail.comwrote:
Hey there.

My name is Rowan, and it's been three weeks since I last used tables
for an HTML design.

Okay, I'm rather new to CSS and I have a big positioning problem here.
It might not be a really huge problem, but I've been fighting it for
days, and have received no help so far. Have a look at this (try it
out in IE and Firefox please) http://www.discoverourmusic.com/rowan/css/home.html
- The problem's with the fairy at the top. On firefox (at least, my
firefox 1.5.0.11) the fairy is blocking horizontal space and the text
(which in the page provided is actually "test") is shifted slightly to
the right and isn't centered. Which I don't want. If you try it out on
IE, it's even worse. I have IE 6.0 and there's a vertical space
between my fairy and the beginning of the page.

Why?
It's because "test" is centered in the horizontal space available, which
is the space between the right edge of the fairy and the right hand edge
of the container.

The problem with the fairy is that she's relatively positioned.

The way relative positioning works is that everything is first formatted
as if there were no relative positioning. Then at the last minute things
are translated by their relative offsets. So the fairy leaves a "gap"
behind, 175px below where she actually appears, which the text flows
around, or in this case, is centered to the right of.

Instead of using float, give #Fairy { position: absolute; top: 25px;
left: 0; } and make #Container position: relative to make it the
containing block for #Fairy.

By the way don't use a huge string of adjacent <brelements like that.
Now if you manage to figure out why it's all happening and you have
some magic css command (e.g. -ie-piss-off: none;), please let me know
about it. I just want the fairy picture to exist without taking any
physical space. Is that even possible?
Not literally! But position: absolute does mean that the fairy doesn't
affect the positioning of anything else in your page, but just sits on
top of it, which is what you want.
Does that have something to do with the display: block; thing? I tired
that, and it didn't work either.
No never mind that. Both float: left and position: absolute imply
display: block anyway.
Also, here's how the top part of my template should look like:
http://www.discoverourmusic.com/rowan/css/whatineed.jpg - You'll
notice a sunflower (http://www.discoverourmusic.com/rowan/css/
sunflower.png) behind the right side of the header. How can I place
the sunflower behind the header? Using z-index? That didn't work
either...
Probably using background-image. So long as you set the background image
on an earlier in the source than whatever the element is that you want
on top of it, you should be OK without needing to use z-index.

z-index only applies to positioned boxes (relative, absolute or fixed)
which may be why it wasn't working.
Apr 29 '07 #2
On 29 Apr, 19:58, TheCruelPanda <Rowan.Ri...@gmail.comwrote:
Have a look at this (try it out in IE and Firefox please)
http://www.discoverourmusic.com/rowan/css/home.html
Your HTML is broken and you don't have a doctype declaration. Don't
even think about IE/FF differences until you've sorted this and forced
IE to render in "Strict mode". Then run a HTMl validator over it,
probably by installing Marc Gueury's FF extension. (Most of these
terms should return useful web or usenet searches).

Apart from that, it looks promising.

Apr 30 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Tom Szabo | last post by:
Hi, Just wondering if there are any disadvantage in absolute positioning controls on a page? In example instead of putting the text fields into a table to align properly, one would absolute...
9
by: Bryan R. Meyer | last post by:
Hello Everyone, The problem of browser resizing has become an issue for me. While redesigning my webpage, I set the left and right margins to be auto so that my content would be centered. ...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
14
by: Harlan Messinger | last post by:
What am I not understanding about the definition of { position: absolute; }? "The box's position (and possibly size) is specified with the 'left', 'right', 'top', and 'bottom' properties. These...
6
by: rajek | last post by:
I posted a similar question yesterday, but didn't get an answer that resolved the issue. (Thanks to those who tried though.) The background: I've read in books and online that if you have one...
11
by: NS | last post by:
I am relativly new to css positioning and have a question regarding the display of a DHTML pop-up Here is the basic HTML I am using: <html> <head> <script language="JavaScript"> <!--
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
3
by: Rangy | last post by:
Hi, I've decided to take the plunge and move from tables to a pure css layout. I still "think" in tables when I do my layouts and I was wondering the following: I have a simple, standard two...
2
by: Michael7 | last post by:
Hi everyone, I'm new to CSS of course, and have been trying to learn it. However, when I try to pull off something as simple as positioning of text . . . nothing works in my index page. So in...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.