The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> div in PHP function
avdovm
post Aug 6 2021, 04:12 AM
Post #1





Group: Members
Posts: 2
Joined: 6-August 21
Member No.: 28,032



Hello!

i am a student and i am working on a project. So i am a beginner and also new here biggrin.gif

CODE

<body>

    <?php
    if(!empty($login_error)){
        echo '<div class="alert-false">' . $login_error . '</div>';
    }        
    ?>


so this function creates a text, telling the user, that the pass is wrong.
But i also want to include a box behind the text

CODE
<div id="alert-box"  >


i am using the div class for the text postion, when i try to add the "box" to the div class the text is not centered.

i'm giving up wacko.gif

This post has been edited by avdovm: Aug 6 2021, 04:15 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 6 2021, 05:43 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



Hello!

QUOTE(avdovm @ Aug 6 2021, 11:12 AM) *

i am using the div class for the text postion, when i try to add the "box" to the div class the text is not centered.

What do you mean with adding the "box" to the DIV class?

Centering is normally done with CSS, but there's none of that in your code example. Could you post a code example of the complete, rendered HTML code (not the PHP)?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
avdovm
post Aug 6 2021, 06:04 AM
Post #3





Group: Members
Posts: 2
Joined: 6-August 21
Member No.: 28,032



sure my bad, here is the HTML style:

CODE
    <style>
        .alert-textbox {
            color:#ffffff;
            top: 275px;
            left: 830px;
            margin: 0 auto;
            text-align: center;
            -ms-border-radius: 17.5px;
            -o-border-radius: 17.5px;
            -moz-border-radius: 17.5px;
            -webkit-border-radius: 17.5px;
            border-radius: 17.5px;
            background:rgba(240, 52, 52, 1);
            padding: 5px 5px;
        }

    </style>


The problem i have now, is that the aligin is left

How it displays text:
Wrong Password
Wrong User

How it should display the text:
Wrong Password
__Wrong User

This post has been edited by avdovm: Aug 6 2021, 06:14 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 6 2021, 09:13 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



".alert-textbox" is a selector for a CLASS, but the DIV element uses an ID.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 31 2021, 04:43 AM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



To access a database, or anything on the server, I'm afraid you need something more advanced. You need a server side programming language as for example PHP.

No biggie, but it's better if you create a new topic instead of adding to someone else's thread if the problem isn't the same.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 11:50 AM