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 ?!?!?!?

 

 

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;}

 

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

  Quote

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

already said so.

  Quote

oh and what is box=-width

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

  Quote

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.

 

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

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.