Codarz360 Posted March 14, 2011 Share Posted March 14, 2011 Hey, I'm developing a user management system for a personal project to improve my web development skills and I'm struggling with a problem which is caused by me only knowing a little CSS. Basically I've got a bunch of expressions to output if the username, password and things are incorrect and I want this to output in a different colour directly above the form and I don't want the form to down the page when the error message displays just above the form. The form is slap bang in the middle of the webpage and I don't want it to move anywhere just stay in the exact same place with the error message displayed if the expression evaluates to false. Here is my script in action so you can see what I mean.... http://www.codarz360.co.cc/user_sys/login.php Thanks in advance for any help. Quote Link to comment https://forums.phpfreaks.com/topic/230588-php-css-output/ Share on other sites More sharing options...
cssfreakie Posted March 14, 2011 Share Posted March 14, 2011 your link doesn't work, But there are several ways to do this. But i think the solution would be to use an absolute positioned div with the error stuff in it. just giv it a higher z-index as the rest and it would be good. Keywords to google are in bold. Quote Link to comment https://forums.phpfreaks.com/topic/230588-php-css-output/#findComment-1187326 Share on other sites More sharing options...
Codarz360 Posted March 14, 2011 Author Share Posted March 14, 2011 Thanks for your help I will take a look on Google. Here is the working link by the way - http://www.codarz360.co.cc/projects/user_sys/login.php Quote Link to comment https://forums.phpfreaks.com/topic/230588-php-css-output/#findComment-1187428 Share on other sites More sharing options...
cssfreakie Posted March 15, 2011 Share Posted March 15, 2011 Ah that site looks familiar. I saw you gave it a position fixed. Problem with that is that it wont work with IE 6 You could do the following instead: #output { border: 0 solid #999999; color: #F2F2F2; font-weight: bold; margin-top: 140px; position: absolute; width: 99%; } #output p{ text-align: center; /* because div output has a width of 99% A p-element inside it will now be centred in the middle */ } html: <div id="output"> <p>You must fill in a username and password.</p> </div> Also good to know absolute positioned element are removed from the normal flow. Unlike position static or relative, those still claim their space. Quote Link to comment https://forums.phpfreaks.com/topic/230588-php-css-output/#findComment-1187582 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.