Centers nicely in IE8 but not in FireFox

  • Thread starter Thread starter AAaron123
  • Start date Start date
A

AAaron123

The following centers nicely in IE8 but not in FireFox

Neither the contents of the Header nor the Item templates are centered in
FireFox.

Do you know how to fix that?



Thanks



<asp:Content ID="Content6" ContentPlaceHolderID="BottomCPH" runat="Server">

<div runat="server" style="text-align: center">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<asp:DataList ID="ItemsList" BorderColor="black" CellPadding="5"
CellSpacing="5"

RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="4"
DataSourceID="ObjectDataSource1"

runat="server">

<HeaderTemplate>

<div style="text-align: center">

<h4>

THE FOLLOWING ALBUMS ARE CURRENTLY AVAILABLE</h4>

</div>

</HeaderTemplate>

<ItemTemplate>

<div style="text-align: center">

.... not centered either
 
Its true as many of us have finally learned and accepted: Firefox is the
best browser to design and test the development of Web sites and then we
have to go backwards to create all of the extra work to cope with the worst
software program written in the history of computer science; IE.

SO YOU'RE WORKING BASS ACKWARDS GET IT?
 
Mark said:
That's why you should be developing and testing against FireFox, not
IE...

In VS2008 can one use FireFox with Debug/Start Debugging?
How about Debug/Start Without Debugging
(I know about right clicking Default.aspx and selecting Browser With.)
<div runat="server" style="margin-left:auto;margin-right:auto;">

Now the behave the same but unfortunately neither center.


BTW
I don't have this but have been wondering if and element can have a class
and a style on it?
Maybe if you wanted to add to or modify the style.
 
I guess the problem is that I don't know how to set up
Debug/Start Without Debugging
Debug/Start Debugging
to open FireFox

Thanks
 
Mark said:
Yes - in fact, I generally use Google Chrome because it's so
lightweight...
I moved your statement. OK here?


....snip


OK, try this:
<div runat="server"
style="margin-left:auto;margin-right:auto;text-align:center;">



There are various rules which govern the rules for priority, e.g.
http://www.developerfusion.com/article/3833/using-cascading-style-sheets-css/4/

We're getting there!

Now everything on the page centers except the asp:DataList.

I put a green border on it so I can be sure what is happening.
The asp:DataList's contents are centered in the asp:DataList.
But the asp:DataList is not centered on the page.
Elements below the asp:DataList are centered OK.

I see now I can try moving the ScriptManager but can't think of much else to
do.

Thanks a lot
<asp:Content ID="Content6" ContentPlaceHolderID="BottomCPH" runat="Server">

<div id="Div1" runat="server"
style="margin-left:auto;margin-right:auto;text-align:center;">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<asp:DataList ID="ItemsList" BorderColor="green" BorderWidth="5"
CellPadding="5" CellSpacing="5"

RepeatDirection="Vertical" RepeatLayout="Table" RepeatColumns="4"
DataSourceID="ObjectDataSource1"

runat="server">

<HeaderTemplate>

<div id="Div2" runat="server"
style="margin-left:auto;margin-right:auto;text-align:center;">

<h4>

THE FOLLOWING ALBUMS ARE CURRENTLY AVAILABLE</h4>

</div>

</HeaderTemplate>
 
AAaron123 said:
I moved your statement. OK here?


I can't find such an option to set

I'll read this but have not had luck in the past finding the answer to this
question.

We're getting there!

Now everything on the page centers except the asp:DataList.

I put a green border on it so I can be sure what is happening.
The asp:DataList's contents are centered in the asp:DataList.
But the asp:DataList is not centered on the page.
Elements below the asp:DataList are centered OK.

I see now I can try moving the ScriptManager but can't think of much
else to do.

I got it.
Added your style to the DataList

Thanks
 
Back
Top