div in PHP function |
div in PHP function |
avdovm |
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 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 This post has been edited by avdovm: Aug 6 2021, 04:15 AM |
Christian J |
Aug 6 2021, 05:43 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
Hello!
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)? |
avdovm |
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 |
Christian J |
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.
|
pandy |
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. |
Lo-Fi Version | Time is now: 23rd April 2024 - 11:50 AM |