With the theme editor update now live, we thought we would write a little tips and tricks post about some of the things you can do with the new custom css feature.
Using the Custom CSS feature does require some knowledge of CSS, if you are not familiar with it and are interested in learning, we recommend checking out the W3 Schools website -
http://www.w3schools.com/css/default.aspRepositioning ElementsOne of the many features of CSS is the ability to reposition elements on the page. Here is a few examples:
Place Main Menu Above BannerSay you want to position the main menu above the banner (by default it is below). You can do this by adding this custom css to your theme:
/* position main menu above banner */
#main_menu { position: absolute; top: 0px; width: 1000px; }
#banner { margin-top: 28px; }
/* hacked added for IE7, as it renders incorrectly */
#banner { #margin-bottom: 10px; }
What this does is reposition the main menu absolutely to the top of the page. By default, the main menu is set to use all of the available width, so since it has been moved out of the normal flow of the page you will want to set the width of it to the same width you have set for your theme so that it looks correct (in this example, 1000px). You can find out or change the width of your theme by clicking on Global Settings.
The banner also needs to be told to make space available to fit the main menu above it, so we add a 28px space above the banner (the height of the main menu). And, since IE7 is not web standards complaint and fails to render this properly, we add a hack to make it look correct on IE7; the #margin-bottom is not valid css so will be ignored by standard complaint browsers, but IE7 will still use it.
Place the user status bar at the bottom of the browser windowFor another example, say you want to position the user status bar to be at the bottom of the users browser window, so it is always visible there even while they scroll the page.
To do this you would add this line of css:
/* fix position user status to bottom of browser window */
#user_status { position: fixed; bottom: 0px; left: 15%; width: 70%; border: 1px solid black !important; }
This will position the user status bar right at the bottom of the browser window, in a fixed position, so it stays there even while they scroll the page. We set the user status to be 70% of the width of the page, and starts from 15% of the left of the page, this will make it appear centered and look a little nicer. Finally since by default the user status has no side or top borders we add them; the "!important" statement tells css to give this rule higher priority then others, to ensure our border will be set.
If you wanted, you could also position this at the top of the browser window rather then the bottom, by just changing the bottom: 0px to top: 0px:
/* fix position user status to top of browser window */
#user_status { position: fixed; top: 0px; left: 15%; width: 70%; border: 1px solid black !important; }
*note: this trick requires the browser to support the css rule position: fixed, it is well supported in all modern browsers such as Mozilla Firefox, Epiphany, Safari, and Opera. It does work in IE 7 also, but it will not work with IE 6.Over-writing existing stylesWith the Custom CSS feature, you can change or over-write any style that we apply to your site.
To find out what styles we apply to your site, you can right click on the page while viewing your guild site and go to "View Source", then right at the top of the page you will see two stylesheet links.
Our default styles:
http://assets0.mmoguildsites.net/stylesheets/design_v3.css
Your custom styles, which are generated from the theme editor: (the id will vary depending on your site)
http://assets0.mmoguildsites.net/stylesheets/custom/41310_style.css
You can view these and if you see anything you dislike or want to change, you can just modify those rules and paste them into the custom css. Because you are over-writing styles, you will likely want to include the "!important" rule with them, to ensure your rule takes precedent to the existing rules. Here is a few examples:
Changing font scalingWe make text smaller in some parts of the site when we feel it is less important, and larger in other parts of the site when we feel it is more important, we do this primarily with the css classes .small_font and .large_font, which set the font to be either 90% the original size or 120% of the original size. You can over-ride these styles, if for example you wanted the small_font to be even smaller, say 80%, and you wanted the large font to be even larger, say 130%
/* change font scaling for small and large fonts */
.small_font { font-size: 0.8em !important; }
.large_font { font-size: 1.3em !important; }
Changing side blocks spacingBy default we add a margin to the bottom of the side blocks, to space them out slightly from each other to look more correct. If you were planning to add your own graphics for the side block and wanted to create a linked effect, where all the side blocks were together, you may wish to remove this spacing. You can disable it by adding the css:
/* make sideblocks positioned together without vertical spacing */
div.side_box { margin-bottom: 0px !important; }
Adding your own extra stylesAlong with changing any styles we set and repositioning elements, you can also add your own additional styles to the site, adding some extra visual flair. Here are a few examples:
Making Menu Links UppercaseYou could make your menu links stand out more by making them all uppercase with the css rule:
/* make main menu links small-caps */
#main_menu { font-variant: small-caps; }
Make Calendar weekends have their own colorWe have extra css classes on quite a few elements in the site you can use to add extra styles, and one example of this is with the calendar, the weekends have the class .weekend, so you can use this to color those differently if you would like:
/* make calendar weekends a special color */
table.calendar td.weekend { background: #1c1c1c !important; }
Hopefully that shows some of the things which you can do with the custom CSS feature.
We have created an example theme with the custom css from this blog post applied to it you can view and play around with here -
http://www.mmoguildsites.com/themes/41305. (all of the styles except the side blocks spacing one are applied to it)
If you come up with a creative use for the custom CSS feature or the theme editor we'd love to see it, email us to let us know at staff@mmoguildsites.com
Here's the thing, I know I'm an old broad and therefore set in my ways and so forth... But some of the recent changes have caused problems for my guild members. The biggest issue is that forum posts are no longer clearly separated. For instance, if a member doesn't have a signature block that he adds to his posts, it's VERY hard to tell where Member Aaa's post ended and Member Bee's post began. I have gone back to the theme editor -- which completely made me blink, I had a hell of a time getting my browser window to show that whole page at once, for instance -- and have not figured out any way of separating one post from another "visually". I don't generally mess with CSS; I figure you guys set that stuff up on purpose to make things easier -- but if that's what I need to alter in order to get clear divisions between forum posts, let me know. If there is something else I'm doing or not doing, or just flat out missing, tell me! I won't bite, honest... I just want my members to be happy (aka, read the stuff they're supposed to read, preferably before a raid!)
I took a peak at your site and noticed the table header color and the container background color are the same (looking here - http://sanitysedge.mmoguildsites.net/forum_threads/57685).
If you made the table header a different color from the container background color, the separation may stand out better =)
The theme editor is mostly designed to be easy to use and only change the visual style for your site, and not positioning (else it would likely be too complex), but if you did want to add some spacing between forum posts you can do this with the custom css feature. Each forum post has the css class 'forum_post' assigned to it, so you can add 10px of space to the bottom of each to space them out by adding the css:
div.forum_post { margin-bottom: 10px; }
to your custom css, and then saving the theme and applying it to your site. =)
I hope that helps, if you have any troubles with it feel free to email me at anytime.
I'd like to replicate the "View Unread Posts | View Todays Posts | Mark All Posts As Read" part of the forum statistics to the TOP of the forums, not the bottom where it currently sits. I don't want to move the entire box...way too much info...but just that one line of the box replicated above the forums. Is there a line of code I can use to do this? Or will it require moving the entire box? Or is it not even possible?
Also, (and no this doesn't really direct itself to CSS, but not sure if it is something that can be added with CSS) is there an ability to create sub-forums with a forum board? We have a ton of forums, and it would be so much....cleaner....looking if I could condense into boards with sub-forums (like Class Forums, or Raider forums, etc.).
Oh! And one more thing...I promise! Is there going to be a way to pull information from the WoW Armory for the Bank page? (Completely unrelated I know, I apologise.)
Thank you for all the hard work! It's looking great!
Stripping the links from the forums statsbox and placing them near the top of the page would unfortunately be difficult with css and likely not work well. You could add a link to your main menu for view unread posts, linking to '/forums/view_unread', or you could add a side block to your site and include the links there.
For subforums, we allow for division of the forums with the forum sections and forum categories, but we do not currently have support for true subforums.
For the WoW Bank, this is a feature we want to support, but as Blizzard has required a login to the armory to access the information it has made us hesitant to try to support it, as we do not wish to store WoW account passwords on our server.
Thanks for your comments =)
I was trying to make the forum cateogry about 50% of its current size and add this space to the last post column. Ideally that would go down to about 2 rows.
To accomplish this with the custom CSS feature you would want to add something like this:
table.layout_table td.forum_last_post { width: 200px !important; }
By default the forum_last_post column is 120px wide, so that line above will change it to 200px wide, you can further adjust it if you would like =)
If you plan to play around with css a fair amount on your site, an easy way to explore it is to get the firebug extension for Firefox, it allows you to click on elements of the site and inspect them, which allows you to quickly see all the styles on an object and where they were applied from.
http://www.getfirebug.com/
I like the hover effect you added on your main menu =)
For the main menu, we have considered making the cell or img the link, but it unfortunately has a few issues, specifically with IE, that make it difficult to support. This is something we will likely support in the future though.
For the main menu width, as it is a one row table, most browsers will not space the items out evenly, giving rows with longer names more space; this causes the menu to not look very correct; to prevent this we calculate the width from the available space and force it, to keep the table space even.
If you choose to use images for your main menu, we compact the table and allow you to determine the spacing; you can load the tiro theme as an example - http://www.mmoguildsites.com/themes/54 - which has images for its main menu.
p:first-letter
{
color: #ff0000;
font-size:xx-large
}
<p>
No it's not that kind of nut.
</p>
http://www.w3schools.com/css/tryit.asp?filename=trycss_firstletter
You can view the source of your website and find the block, it should have an ID attribute with something like: < div id='block_12345' >
You can then target it with css, and do:
#block_12345 div.message p:first-letter { color: #ff0000; font-size: xx-large; }
You would place that line of css in the Custom CSS section for your theme; you can reach this by loading your theme into the Theme Editor and then clicking the custom css button. After you add the custom css you would need to re-apply the theme to your site.
Then in your HTML block, you can insert a p tag, and the first letter of it will be large and red =)
The banner text is read from your "Guild Name" and "Guild Slogan" in the Settings tab of your Site Admin. If you upload an image to use as your banner, the text is hidden and you would instead include the text as part of the image.
Custom CSS is not meant as a required feature for creating your site, the Theme Editor is setup with all of the main features you should need to create the appearance for your site, allowing you to change the colors and graphics for all of the elements of your site, along with a few extra options. Custom CSS is more meant for advanced users looking to do something unique or to tweak a specific part of the site we cannot include in the Theme Editor.
The Theme Editor is a simplified view of your site, which has all of the elements which are used on your site, but compressed into a more manageable view; if you are curious how some of them look on your site you can apply any of the public themes to your site, and then load some you are interested in and begin customizing them with the Theme Editor, which will hopefully give you an idea how it all works =)
If you have any questions you can post back here or feel free to email me anytime at eight-toes@mmoguildsites.com =)
Cheers,