0

I have a div that is initially hidden

<div class="create_member" style="position:absolute; display:none;" >

I want to unhide it when my variable is "1". I currently have this code but it does not unhide the div.

<?php
if ($choice == "1"){
   ?>
   <style type="text/css">.create_member{
   display:block;
   }</style>
   <?php
   create_member($address_book);
}

How should I go about this?

1 Answer 1

1

Use the !important property to override the existing style.

if ($choice == "1"){
   ?>
   <style type="text/css">
   .create_member{ display:block !important; }
    </style>
   <?php
   create_member($address_book);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.