Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:53:32+00:00 2026-06-08T08:53:32+00:00

hello i have a problem using z-index. i have a form with some input

  • 0

hello i have a problem using z-index. i have a form with some input fields. beside them i have some error divs for echoing the php error messages. the problem i have is, that the error divs, that only will come up when a error is set, leads to a line break for the input fields.

.wrapper   #mainframe   #left #frame form fieldset ul .fr {
    width: 180px;
    float: left;
    margin-bottom: 18px;
    margin-left: 25px;
}
.wrapper #mainframe   #left #frame form fieldset ul input.err {
    width: 180px;
    height: 18px;
    line-height: 18px;
    padding-left: 5px;
    margin-top: 3px;
    outline:none;   
    background-image: url(../images/error.png);
    background-repeat:no-repeat;
    background-position: 172px 50%;
}
.wrapper #mainframe #left #frame form fieldset ul .erl {
    color: #FFF;
    position: relative;
    z-index: 1;
    background-color: #f23;
    width: 200px;
    height: 30px;
    font-family:Arial, Helvetica, sans-serif;
    font-size: 10px;
    font-weight: bold;
    line-height: 30px;
    text-align: center;
    left: +217px;
    top: 25px;
}

here is the html code:

<li class="fr">
<label for="a">a</label>
<?php if (isset($errors['a'])):?>
<input class="err" type="text" id="a" name="a" value="<?php echo isset ($_POST['a'])? $_POST['a'] : ''; ?>" tabindex="20" autocomplete="off"/>
<?php if ( isset($errors['a']) 
&& empty($errors['a'][0]) == true ):?>

<?php echo "<div class='erl'>"; 
echo $errors['a'][0];
echo "</div>";
endif;?>

<?php endif;?>

so i dont understand why this is happening. i thought using z-index would be something like causing two layers (z-index:0 and z-index:1) so that there should be enough place left and right hand side on the second layer z-index:1. if there is someone who could tell me how to solve this i really would appreciate. thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:53:35+00:00Added an answer on June 8, 2026 at 8:53 am

    I would look for things like padding and margin (http://css-tricks.com/the-css-box-model/) that may be adding unintended spacing and overall width.

    Also, check to be sure that whatever elements you apply z-index have their position explicitly declared… also the positioning of the parent elements (http://tjkdesign.com/articles/z-index/teach_yourself_how_elements_stack.asp).

    Finally, I would look at issues with the hasLayout property (http://www.satzansatz.de/cssd/onhavinglayout.html). This may be what Vinny is talking about, since Z-index does not change the way the document flows so much as the stack order. Try using position:absolute on your error messages to remove them from the overall flow of the document.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i have some problems with my php ajax script i'm using PHP/mysql i
Hello i have the following problem, I record a video using red5 like this:
I have this problem when trying to run hello world program using android SDK.
Hello I have a problem with trimming string in c++. It adds some weird
Hello I have a problem to retrieve a value from a method. I'm using
Hello everyone I have a difficult problem with using BULK INSERT command when I
Hello I have a problem using latest vim with omnicompletion while editing a file
Hello i have problem with putting logs using multithreading, my function loks like this
Hello I have a problem. I am using the below function to create a
Hello i have got a problem, if I try to display maps with using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.