Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/230588-php-css-output/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/230588-php-css-output/#findComment-1187326
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/230588-php-css-output/#findComment-1187582
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.