PHPRunner 7.0 and ASPRunnerPro 8.0 add a new new ‘Custom CSS’ feature – an easy way to modify the appearance of your pages adding bells and whistles Style Editor doesn’t support. Lets see how we can build a custom login page similar to this one:
Lets start with some basic stuff.
Here is how you can set image as a background of the login page:
What is body.function-login by the way?
body.function-login means this background will be only applied to the login page. If you want to apply this background to all List pages use the following:
To figure out class names of individual pages you will need either Firefox browser with Firebug or Chrome. Here is the screenshot of body tag inspected in Chrome Developer Tools.
What if I want to apply this background image to all page in my application?
It’s not difficult at all. Simply use body tag in Custom CSS:
Okay, I’m getting it. What if I have a single List page that needs to have her own background?
This can be done as well. Custom CSS belongs to the current selected Style. If you assign a custom Style to one of List pages you can use Custom CSS that will be assigned to that single List page only.
We proceed to the Style Editor, make sure this List page is selected, choose “Apply to the current page” in Styles section and choose a different style for this page. Now we can proceed to Custom CSS and set different image as a background for this page.
Got it. What about that semi-transparent login form?
Here is the code that does the job.
What about Add page? I need the same look and feel there.
It will be slightly different. The same idea though.
I have applied this code to the login page. This is what I got.
Not bad! This can be enough for most projects however with some extra work we can make it look exactly like a screenshot of the beginning of this article. Lets get started.
1. Proceed to Security screen, turn on Facebook login and Password reminder.
2. Proceed to Style Editor, select Login page on the left, choose ‘Apply to the current page’ option from ‘Project layouts’. Choose login1 layout.
3. You may notice that login page form is a bit wider than what we are after. Click ‘Customize layout’ and remove width=500 snippet.
4. Lets spend some time in Visual Editor now. We need to move Facebook button to the top and also move username/password labels so they appear on the top of input boxes.
Before moving form labels I recommend to turn on Show Borders mode.
Drag username input box to the left column and position it under Username label. You will need to use Enter button to insert a line break between the label and the field itself. Do the same with password field. Now delete the right column, we don’t need it anymore.
Moving Facebook button should be easy. Just click on it and drag it to the top of the form.
5. Now lets change some labels. Click on ‘Submit’ button, switch to HTML mode and change ‘Submit’ to ‘LOG IN’.
6. Switch back to Visual Mode. Select ‘Remember password’ link and switch to HTML mode again. We need to modify this link adding CSS forgot class. This class will be later defined in Custom CSS section. Here is how Remember password link is supposed to look in HTML code.
7. Since built-in Facebook button doesn’t support the style we looking we need to replace it with own own button. For this purpose click on Facebook button, switch to HTML code and replace button’s HTML code with the following:
It will not look nice until we apply our custom CSS. Do not worry, we’ll get to it in a few seconds.
8. Now here is the CSS code and glues it all together. I’m posting it as a single code snippet so you can copy and paste it to your project. Note that this code requires one more image file (facebook.png), that appears on Facebook button. You can download it from the Web, upload somewhere to your website and modify image URL in CSS code accordingly. We use icon size 29x29px in this example.
9. One last piece is the “LOG IN” button styling. In this example I have done this using Style Editor. Remember that this is the “Main button” style. Use ‘Lato’ font, 16px font size, bold if you want to create something similar.
If you done everything right here is how your login page is going to look in Visual Editor.
“Message” area is where “Invalid login” message will appear.
What else would you like to know?