Jump to content

text-align in Firefox


gazfocus

Recommended Posts

I have created a navigation bar in a div and centred its contents (because until the user logs in, there's only 3 buttons visible), and it's centred perfectly in Internet Explorer, but it's not centred in Firefox.

 

The css that centres is in IE is

 

#navigation {

width: 100%;

height: 35px;

background-color:#0066FF;

text-align:center;

z-index:2;

}

 

Any thoughts?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/104277-text-align-in-firefox/
Share on other sites

Show us the website your talking about. What do you mean it's not centered perfectly in FF...?

 

FF = Firefox

 

I can't show the site as it's not live (I use Server2Go which makes my computer act as a server before publishing the site).

 

The code for the home page is:

<? session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Homepage</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="container">
<div id="head"><? include ("heading.html") ?></div>
<div id="nav"><? include ("navigation.php") ?></div>
<div id="content">
    <h2 align="center">Homepage</h2>
    <p align="center">Welcome to the homepage. These links above will navigate you through the site. Search books enables you to <br /> find books in the database. Manage books has three sections: Add, Edit and Delete a book. The my account <br /> section lets you view your account details and the logout link allows you to logout of your session. </p>
    <p> </p>
    <p> </p>
<center><img src = "images/stackbooks.jpg" alt = "stack of books" height= "150" width = "250"> </center>
  </div>

</div>
</body>
</html>

 

The code for the navigation is:

 

<? session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Heading</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<style type="text/css" media="screen">
@import url("managebooks.css");
</style>
<script language="JavaScript1.2" type="text/javascript" src="mm_css_menu.js"></script>
</head>

<body>
<?
if ($_SESSION['authorised'] =='yes')
{
include("navigation2.html");
}
else 
{
include("navigation1.html");
}
?>
</body>
</html>

 

And the CSS is:

 

body {
font-family: Arial, Helvetica, sans-serif;
}

td {
font-family: Arial, Helvetica, sans-serif;
}

th {
font-family: Arial, Helvetica, sans-serif;
}
#container {
position:relative;
margin: 0 auto;
width:800px;
height:500px;
}

#navigation {
width: 100%;
height: 35px;
background-color:#0066FF;
text-align:center;
z-index:2;
}

#content {
width: 100%;
height: 365px;
border: thin solid #0066FF;
z-index:1;
padding:0;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.