New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Styling the login box

From: Joomla! 1.5: Styling with CSS

Video: Styling the login box

Now that we have got our homepage looking great, I am going to style the Login Box to make it match the nice look that we have going on, on the right side of this page. This is the default styling for the login box and the little border that you see going around the Username and the Password is from the Field Set tag, if you haven't encountered that particular HTML tag before. We have two links at the bottom. You may have three depending on how you have your Joomla! configured. I have my Joomla! configured to not allow registrations on the website.

Styling the login box

Now that we have got our homepage looking great, I am going to style the Login Box to make it match the nice look that we have going on, on the right side of this page. This is the default styling for the login box and the little border that you see going around the Username and the Password is from the Field Set tag, if you haven't encountered that particular HTML tag before. We have two links at the bottom. You may have three depending on how you have your Joomla! configured. I have my Joomla! configured to not allow registrations on the website.

If you have registration on the website enabled, you may have an extra bullet at the bottom that says to sign up for an account essentially. So let's go ahead and get started with styling this login box. So we are going to go to CSS > Edit CSS. And I am going to go to the default.css page and I am going to scroll down to the right area of our style sheet. Well, you have a lot of styling in here for the featured products area and now we are going to add styles here for the login.

So I am going to start by styling the outside box, which of course is always a div.module table. I am going to set a width on this around 220 pixels which will make it a little bit narrower, and a smaller font size because we want to deemphasize this login box relative to other things on this page. I am also going to set a background color, which will set off the box just a little bit from the rest of the page itself. Now, we have our words and our boxes running up right against the edge of that colored box.

So I am going to need to add some padding. Let's also push the box over, so that it lines up nicely with the Our featured products on top. Right now it's skewed a little bit to the left. We can do that with margin, and finally let's separate that login box from the Our featured products. We will give a little margin on the top. Now I am going to style my H3, and actually I want my H3 for the login to look pretty similar to the H3 that I have for Our featured products. But I'd really don't want that left styling. In Our featured products, we have a big set of padding on the left side that's associated with H3, and we have a dark color as well.

So I am going to setup my H3 for the login box as a separate style. So right div.moduletable h3. Let's give it a color of white and the Georgia font that we have been using, which is font family, Georgia and Serif. Once again, we want it more of a normal weight. So a font weight of normal, which will make it less bold, and a size of 14 pixels. Now, let's get rid of that ugly field set border that you see around the Username and Password.

So once again, right div.moduletable field set, and we will just set the border here to None. Now, I would like to style this login box down here to match other buttons that we have had on the website. I am going to make it brown. So right div.moduletable input.button. Generally speaking, all of the buttons on a Joomla! website have the same class of button. Let's set the text color to white, which is fff, and we will set our background color to Chocolate Brown, 463 11c. And finally, we will set the border around that button to None.

Now finally, these last two links on the bottom here for Forgot your Password or Forgot your Username, they are kind of far apart and I would like to do a little bit more with the alignment with them. So let's work on styling the list that's in this login box. So right div.moduletable ul, we want to list style type of None to get rid of the bullets. Then we are going to put some padding just on the left side, 0 0 0 and 5 pixels.

This gets rid of some of the residual padding that we have had associated with this before based on other styling further up in the style sheet. And finally, let's set the margin to 0. That will help with some other web browsers. Finally, I would like to put just a little bit of padding around those individual links. But again, I am going to override what I have earlier for the LI tag for some of the spacing between list items. So this will be right div.moduletable li.

This time, we are going to set our padding to 0.3 ems and that will tighten things up nicely. Now, we have a nice clean line going down the left side from Username down to Forgot your Username. So as our last step, we need to copy all of our CSS and put it into our Joomla! template. So Ctrl or Command+A, Ctrl or Command+C to copy all of our code. Then we will switch to the back end of the website to Extensions > Template Manager, to Inside, Edit, Edit CSS, Default, Edit and now, we are going to say Ctrl or Command+A, Ctrl or Command+ V to paste in our changes and save.

Now, let's Refresh the homepage, and you will see that all of our changes have been incorporated into the website. So login box is very handy for hiding some content away for just registered users, which I will show you how that works in the next video.

Show transcript

This video is part of

Image for Joomla! 1.5: Styling with CSS
Joomla! 1.5: Styling with CSS

22 video lessons · 15850 viewers

Jen Kramer
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold

Are you sure you want to delete this note?

No

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.