CSS positioning cross-browser (well IE, FF)

C

celoftis

I've got html page with has a fixed height - there are five buttons on
the page. The page has a fixed, known height - but the width can
change. The five buttons should be arranged on the page as follows
(all buttons should always be 3px from the top):

"button1" - left edge always 3px from left side of the page
"button2" - left edge always be 5px to the left of "button 1:"
"button3" - buttons three and four should float (relatively) in the
middle of the page
"button4" - left edge always be 5px to the left of "button 3:
"button5" - right edge always 3px from right side of page

Button2 could float to the left of button1 - but I'd like to know how
to get it fixed to the right of button1 by 5px.
A key requirment is that buttons 3,4 are seperated by 5px and appear
to float together (not ever overlap)...


I've tried the following CSS - it works in IE but in FF the buttons
tops (buttons 3,4) don't align.
Anyone have any suggestions:

..Button1 {
position: absolute;
left: 3px;
top: 3px;
}
..Button2 {
position: absolute;
top: 3px;
margin-left: 10%; /* HOW DO I GET THIS BUTTON TO BE 5x FROM
Button1? */
}
..Button3 {
position: relative;
top: 3px;
margin-left: 43.5%; /* HOW DO I GET Button3,4 TO FLOAT
TOGETHER */
} /* AND STAY TOP ALIGNED AT
5px? */
..Button4 {
position:relative;
top: 3px;
}
..Button5 {
position: absolute;
right: 3px;
top: 3px;
}
 
M

Masudur

I've got html page with has a fixed height - there are five buttons on
the page. The page has a fixed, known height - but the width can
change. The five buttons should be arranged on the page as follows
(all buttons should always be 3px from the top):

"button1" - left edge always 3px from left side of the page
"button2" - left edge always be 5px to the left of "button 1:"
"button3" - buttons three and four should float (relatively) in the
middle of the page
"button4" - left edge always be 5px to the left of "button 3:
"button5" - right edge always 3px from right side of page

Button2 could float to the left of button1 - but I'd like to know how
to get it fixed to the right of button1 by 5px.
A key requirment is that buttons 3,4 are seperated by 5px and appear
to float together (not ever overlap)...

I've tried the following CSS - it works in IE but in FF the buttons
tops (buttons 3,4) don't align.
Anyone have any suggestions:

.Button1 {
position: absolute;
left: 3px;
top: 3px;}

.Button2 {
position: absolute;
top: 3px;
margin-left: 10%; /* HOW DO I GET THIS BUTTON TO BE 5x FROM
Button1? */}

.Button3 {
position: relative;
top: 3px;
margin-left: 43.5%; /* HOW DO I GET Button3,4 TO FLOAT
TOGETHER */} /* AND STAY TOP ALIGNED AT

5px? */
.Button4 {
position:relative;
top: 3px;}

.Button5 {
position: absolute;
right: 3px;
top: 3px;

}

Hi...

Try using div ... inside div put your buttons and the apply the style
in the div for each button...
Hope fully it will work
Thanks

Masudur
 
C

celoftis

Ok, I tried the DIVs with partial success - now FF works but IE is
messed up... any suggestions to get them both working at the same
time? Any resources that I should read regarding CSS implementations
per browser?


<html>
<head>
<style type="text/css">
.button1 {
position: absolute;
left: 3px;
top: 3px;
width:10em;
}
.button2 {
position: absolute;
top: 3px;
margin-left: 21.375%;
width:10em;
}
.pnlNavigation {
position: absolute;
top: 3px;
width:10em;
margin-left: 43.5%;
border-style:solid;
border-width:3px;
border-color:Red;
}
.button3 {
position: relative;
/*top: 3px;*/
margin:0;
/*margin-left: 43.5%;*/
/*width:5em;*/
}
.button4 {
position:relative;
/*top: 3px; */
margin:0;
/*margin-left: 52%;*/
/*width:3em;*/
}
.button5 {
position: absolute;
right: 3px;
top: 3px;
width:3em;
}
</style>
</head>
<body
<input type="submit" name="button1" id="button1" class="button1" />
<input type="submit" name="button2" id="button2" class="button2" />
<div class="pnlNavigation">
<input type="submit" name="button3" id="button3" class="button3" />
<input type="submit" name="button4" id="button4" class="button4" />
</div>
<input type="submit" name="button5" id="button5" class="button5" />
</body>
</html>
 
C

celoftis

Yes, I came across that site earlier.. poked around a bit but didn't
find anything specifically related to my problem - this of course
could be that I'm a CSS newbie and don't know the lingo yet. Any
suggestions as identifying the root problem so I know what to look for
on a site like poistioniseverything?
 
I

Ian Semmel

Just hunt around until you find something you like and copy it.

The whole thing is anarchy if you ask me.

When stuck, use tables.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top