Jump to content

my text wont center and browser difrence


supergrame

Recommended Posts

here is the code

 

.error1 {

color:#ff0000;

        text-align:center;

}

 

 

$var = "<span class=\"error1\">Your username/password doesn't exist!</span>";

 

<?php if(isset($var)){ echo $var;} if(isset($wrong_un_pw)) {echo $wrong_un_pw;}

 

in firefox the text is fine it shows red text then the table below it but not center

 

in ie no red and ther is a gap between the text and the table ?!?!?!?

 

 

Link to comment
Share on other sites

try this, works here ie7 and firefox 3,

u have there error msg in span tags, that arent made for aligning and stuff i think.

div's do work:P

 

echo'

<style type="text/css">

.error1 {

 

border:1px solid blue;

box-width:500px;

  color:#ff0000;

        text-align:center;

}

</style>

';

 

$var = "<div class=\"error1\">Your username/password doesn't exist!</div>";

 

if(isset($var)){ echo $var;} if(isset($wrong_un_pw)) {echo $wrong_un_pw;}

 

Link to comment
Share on other sites

you cant center a span to my knowledge or you at least need a width

 

oh and what is box=-width

 

should be

 


<head>
<style type="text/css">
.error1 {

border:1px solid blue;
box-width:500px;
   color:#ff0000;
        text-align:center;
}
</style>
</head>
<body>
<?php
$var = "<div class=\"error1\">Your username/password doesn't exist!</div>";

if(isset($var)){ echo $var;} if(isset($wrong_un_pw)) {echo $wrong_un_pw;} ?>
</body>

 

all style elements like this gop in the head of your document by the way and shouldnt be placed in the actual content

Link to comment
Share on other sites

you cant center a span to my knowledge or you at least need a width

already said so.

oh and what is box=-width

should be just width not box-width. yeah i know:P

all style elements like this gop in the head of your document by the way and shouldnt be placed in the actual content

just put it in there for testing reasons so i dont have to make a whole separate css file

im just showing what he done wrong, with the span tags that's all, not gonna explain to him how css should be implemented.

 

Link to comment
Share on other sites

yea i was trying to stay away from a div since its just one line of text but thank you now at least i no why it wont center, i must css is relay cool in some ways but my god it is very hard to get things looking the way you want it.

 

chairs guys

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.