HTML, CSS and anything else that deals with client side capabilities.
Moderator: General Moderators
alex.barylski
DevNet Evangelist
Posts: 6267 Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg
Post
by alex.barylski » Wed Apr 29, 2009 9:54 am
This works wonderfully in IE but of course not firefox and/or I assume other compliant browsers?
Code: Select all
<div style="margin: auto 0; text-align: center"> <div style="background-color: white; border: 4px solid white; width: 400px; height: 30px"> Make this right align in FireFox? </div> </div>
Apparently (from googling) FF and others should use
margin-left: auto in order to center a DIV within another DIV
But how do you go about right aligning, etc?
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Wed Apr 29, 2009 9:56 am
What exactly do you want? The text right aligned within the the inner div, which is itself centered in the outer div?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
alex.barylski
DevNet Evangelist
Posts: 6267 Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg
Post
by alex.barylski » Wed Apr 29, 2009 10:47 am
I have a container DIV
and inside that DIV I have another DIV which is only 200px wide and a 6 pixel border. Inside this DIV I have a INPUT and BUTTON element.
Code: Select all
<div> <div style="width: 200px; background-color: white; border: 6px solid #eaeaea"> <input type="text" style="border: 0px" /> <button style="border: 0px">GO</button> </div></div>
Applying the
text-align: right in the container DIV works in IE but fails in FF. I am trying to get the inner DIV (and it's elements) to align flush with the right side of the document.
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Wed Apr 29, 2009 11:28 am
What about playing with the position & right properties?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
alex.barylski
DevNet Evangelist
Posts: 6267 Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg
Post
by alex.barylski » Thu Apr 30, 2009 7:34 am
I believe I tried those but only on the <input> and <button> when applied to the inner DIV had no effect.