Tuesday, 4. October 2005, 08:10:03
Styling My Opera profile pages
Note: (12 Nov 2005) This guide isn't really intended for CSS beginners; I assume you to be experienced enough to understand how the most common CSS properties work. I'm mainly attempting to describe the structure of profile pages, and some default style sheets you can't get rid of, so that you wouldn't have to figure it all out yourself.I was asked to post some about the restyling of my profile page which seems to be rather popular this week
The styling is not very complex, just different. The custom style sheet editor lets you choose to either use your styles together with the default theme, or your styles only. If you only want to keep the default theme but change some fonts or colors, you'll be better of opting to keep the default theme. I didn't though.
Even if you use your own CSS only, two common style sheets are still included. These contain some values that you will need to override to ensure that your styles won't break. This is the first ruleset of my stylesheet:
* {
float: none !important;
width: auto !important;
}
I added it because there are so many default float and width values that it's best to reset them all. Next, I set the styles for the 'html' element:
html {
background: #fff url(http://members.surfeu.fi/jerkku/op/pig-bg.jpg) no-repeat fixed bottom right;
color: #222;
font: 10pt/1.3 "Trebuchet MS", sans-serif;
height: 100%;
}
It sets the background to white, and adds my piggy to the bottom right corner. 'Fixed' (the background-attachment) makes it stay where it is (and unfortunately, makes scrolling laggy in most browsers). This will not work in IE unless you use a special workaround. I host the picture myself; I suppose you could use the storage space provided by My Opera too. I also set the default font and color for the document. height: 100% gives the html element the height of the viewport. This is to ensure that my piggy stays at the bottom right even if the document wasn't long enough to occupy the height of the viewport. With height: 100%, the 'html' will not stretch along with the document either, if the document is higher than 100%. If you wanted it to, you could use min-height, which would make the piggy appear on the very bottom of the document (scrolled down), but I've found that it doesn't work as desired in Firefox 1.0 / Mozilla 1.7. IE doesn't support min-height at all but it wrongly stretches a container with a height of 100%.
The next ruleset is the body:
body {
width: 600px !important;
border: 1px solid #444;
margin: 15px 0 15px 15px;
padding: 0 0 10px 0;
background: url(http://members.surfeu.fi/jerkku/op/bodybg.png);
position: relative;
}
Firstly, I set a fixed with of 600px, and I must use !important, else it will not override the auto width that I set in the very first ruleset. I set a border, some margin and padding too, and a 1x1px² PNG background image. The PNG uses alpha channel opacity (you can create such images at least in Photoshop and Paint Shop Pro), which makes the piggy partially shine through, but unfortunately this doesn't work in IE either. IE doesn't set the width either; I'm not sure why but I guess it's related to the !important. I'm not interested in making my profile page work in IE - this is a community for Opera users, after all
* html body {
background: blue url(http://stuff/);
}
Finally, I use position: relative on the body to make sure that the absolutely positioned elements inside the body (we'll get there later) are positioned against the content edge of the body. If you took this rule out, you'd find some elements positioned against the edges of the viewport.
To be able to style all other elements, you will need to view the source code and get a little familiar with it, to know what there is. Unfortunately, My Opera doesn't make it too easy for us because of the lack of sufficient line changing / indenting to make it readable. You will respect Ctrl+F (Find) of your text editor! Look for <body in the source. You will see that inside the body, there are four nested wrapping divs (
The header section starts with a div called #topbar. This is where the Opera Community, FOAF, Messages, and other links reside. I do not style the div, but the two paragraphs inside it: #community and #meta. I set the margin, padding, background and font on #community. #meta contains FOAF and RSS links... yeah, I've hidden those with display: none. I'm a bad boy. In fact, I should probably display the FOAF link, though I see no use for it.
I use generated content to add a colon after the "Opera Community" link:
#community span:after {
content: ": ";
}
This doesn't work in IE either. The links following "Opera Community" have the class "toplink". Because of the community default stylesheets, the following is necessary to make sure the links use the font I set for #community:
.toplink {
font: inherit !important;
}
(Fonts are normally inherited).
#top2 is the div following #topbar. It contains the main heading of your page, as well as the menu ul. The menu ul is a child of a div with id="menu". (It wasn't like this when I first wrote this guide). I set a background, padding and overflow: auto on #top2. overflow: auto is there to make it stretch with its floated child elements. On the h1 inside, I set the font, a zero margin (the containing #top2 div already has a padding), and float: left !important. Again, !important is necessary because I reset all floats in the beginning.
Following the h1, there is a p with ID subtitle. As the ID says, it contains the subtitle below your page title. Again, I zero the margin, and I set a top padding of 15px. I left float it too to align it next to the h1. Finally I use generated content to add the em dash between the heading and the subtitle (i.e. before the subtitle):
#subtitle:before {
content: "—";
padding: 0 5px;
}
There is 5px padding on the left and the right side - otherwise the heading and the subtitle would be squeezed together.
I have five rulesets for the menu ul:
#menu ul {
margin: 0;
padding: 0;
list-style: none;
position: absolute;
top: 45px;
right: 20px;
}
#menu a {
color: #fff;
}
#menu li {
float: left !important;
font: bold 10pt/1.1 "Trebuchet MS", sans-serif;
}
#menu li:before {
content: "|";
padding: 0 5px;
}
#menu ul :first-child:before {
content: "";
padding: 0;
}
First, I zero the margin and padding of #menu ul, and hide the list bullets (list-style). Then I position it absolutely, giving it offset from the top and the right edges of the body (!). (I set position: relative to the body earlier). Then I give the menu anchors a color, and left float the list items to line them up horizontally. All that is left now is to add the delimeter between the list items - for this, I use generated content again. (And generated content still doesn't work in IE). Like the em dash before the subtitle, the delimeters here also have 5px of padding on both sides.
Now, because I've given each list item a delimeter on the left side, I need to remove it from the first item. For this, the :first-child selector will suffice. (Even this doesn't work in IE). I simply revert the content to an empty string and remove the padding.
In the menu, the link pointing to the currently active page has id="selected". You may wish to highlight it somehow to let the user easier know where he is.
I have set display: none on the following selectors: #meta, .hide, #userpic, #aboutme, #aboutwork, #favforums, #grouplist, #footer, #qp, p.newsfeed, #friendlist, .myfriend .mypic, .myfriend .myloc, .myfriend blockquote. I originally did this with the intention of hiding then until I'm going to restyle them, but then I realized I like my profile page simple. Anyway, here's what the hidden elements do:
#meta is the paragraph with the FOAF link, as I described earlier. The .hide class is for a paragraph in div#top with a "skip navigation" link. #userpic is a div containing my user picture - I removed it because mine is the pig you're all familiar with, and it is already visible on my page.
#footer is the thing on the very bottom - "Powered by Opera Community" - I removed it because it should still be apparent that this is an Opera community page. #qp means quick profile (I guess), and is a small, brief profile box on the Links and Friends pages (and Blogs and Photo album too, I presume). It is shown on the right side by default. p.newsfeed is a paragraph on the Links page that tells that a link category is a newsfeed - I hid this too and use generated content to show a slightly different "newsfeed" text next to the category title. (I'll get back to this later).
.myfriend .mypic is the user picture for a friend shown on the Friends page (.myfriend is a container, a div IIRC, that each friend has on the page). .myfriend .myloc is the "Location" line, respectively.
This guide is probably far from complete. You might still need to analyze the source somewhat, but it least it should be a bit easier now. Remember to use Ctrl+F (Edit -> Find) to find things from it. For instance, if you need to see how the favorite links (on the "About" page) are structured, just find id="favlinks" in the source.
Tuesday, 4. October 2005, 22:49:36
Wednesday, 26. October 2005, 19:48:33
Thursday, 27. October 2005, 08:14:00
Thursday, 27. October 2005, 08:31:57
Originally posted by NoobSaibot:
Thanks for reporting & for the compliment.scipio: on your about page are the links for "ignore this user" and "send an email" messed up. they are demanding the same place. nice design
edit: hmm... I guess I have to be logged in as someone else to be able to see it.
Thursday, 27. October 2005, 09:19:13
Originally posted by NoobSaibot:
I won't if you post a screenshot of the error with "ignore user" and "send mail".i ripped off your style for the .tags, hope you don't mind
Monday, 31. October 2005, 10:48:32 (edited)
For those interessed in styled opera blogs, I have listed the one I found here: Styled Opera Blogs
Thursday, 27. October 2005, 09:44:33
If you still want a screenshot:screenshot1
Another thing: The blog pages look a little awkward when you go to a month/day with few or no posts.
Thursday, 27. October 2005, 09:48:01
Originally posted by euricomatos:
Hmm... What should I do with that...If you still want a screenshot:
Originally posted by euricomatos:
Can you give an example (url)?Another thing: The blog pages look a little awkward when you go to a month/day with few or no posts.
Thursday, 27. October 2005, 09:52:41
Originally posted by scipio:
Originally posted by NoobSaibot:
I won't if you post a screenshot of the error with "ignore user" and "send mail".i ripped off your style for the .tags, hope you don't mind
Originally posted by scipio:
http://my.opera.com/scipio/archive/monthly/?month=200509Can you give an example (url)?
screenshot
Thursday, 27. October 2005, 10:06:16
Originally posted by euricomatos:
Yikes!
Monday, 7. November 2005, 00:13:05
Since you must be logged in and looking at another page than yours, I put a screenshot.
Monday, 7. November 2005, 21:05:09 (edited)
Originally posted by mmichel:
hmm... will take a look at it (soon).@scipio: your "about" page is still bogus managing
edit: Is it OK now?
Tuesday, 3. January 2006, 13:12:30 (edited)
About me page
Below is the blog link:up:
Link to Blog
simple I know, but I'm happy:happy:
Thanks to all for posting user CSS codes:yes:
<edit> I have since restyled using Freds code as a base and borrowing for everywhere.
My personal pages use only my css file.
When i designed the aquariums group page, the group forum layout worked better using combined css.
I am working hard, when I have time available, to understand all the fields affected by group css commands, as customizing individual group forum elements requires this.
Thursday, 17. November 2005, 10:22:58
Originally posted by Jere:
a 1x1px² PNG background image. The PNG uses alpha channel opacity
Try using a larger size background image instead. It will speed up the page's performance.
A 1x1px² background image, although saves space, eats up a lot of re-drawing time. This also applies to Opera on mobile phones.
This applies only if you're working with alpha channel images. Otherwise it does not make a big difference.
Tuesday, 13. December 2005, 21:16:08 (edited)
Sunday, 11. December 2005, 23:38:42 (edited)
Tuesday, 13. December 2005, 21:23:13 (edited)
Originally posted by froggy420:
I know enough html & css to change the background and colors and fornt sizes but thats about it. Can you help me with my page. All I really need to know is where do put the page elments. Here is my first attempt.
Can someone tell me what I need to do to change all the black text to white.
Tuesday, 3. January 2006, 12:46:54
#menu_blog a
{
content: "New Button Name";
}
#menu_friends a
{
content: "New Button Name";
}
#menu_about a
{
content: "New Button Name";
}
#menu_albums a
{
content: "Images";
}
#menu_links a
{
content: "URL's";
}
anyone know how to add another button?
Wednesday, 4. January 2006, 15:01:58 (edited)
Originally posted by salmondine:
anyone know how to add another button?
I can only do it via JS... & I don't think we're supposed to know how to use that on these pages. Besides, it only works in Opera or IE (Firefox doesn't like how I do it)
This is going to seem like an trivial worry, but does anyone know what font Firefox uses for "♥" (BLACK HEART SUIT, Unicode char 0x2665)? I've used it on my own profile page as decoration, but I can't work out what font to set. It's currently Arial, which has a fairly pleasant glyph, but I like the one Firefox uses more (it has a recurved spike).
Also, does my page have any dodginess like scipio's did, where only another logged in user can see it?
Thursday, 9. February 2006, 07:44:22
I am in the process of changing mine
I now am trying to understand how to change the background color of my sidebar items
and to change the color of the words in my about area as well as its background color.
I would like to make my calendar to be transparent
Of course I would have never gotten this far by trial & error without Ivan's fantastic help
Thursday, 11. May 2006, 09:01:58
Maybe I should do something with my own Opera blog as well?
But I really miss the ability to add costume HTML at My Opera. So I think I will stick with Blogger for now.
Thursday, 8. June 2006, 04:44:56 (edited)
Too many weight for images or fast? Some link or position x-y bad?
Report me please
The open code is in my root.
See u
PS-
Thanx Salmondine for the name button code and geek guys
The same code of Salmondine with add
:hover { ... }
Friday, 29. September 2006, 14:29:25
Also Fx extension DOM Inspector helps a lot.
Good work, Jere!
Monday, 2. October 2006, 18:25:18
Just now I wanted to show it, and saw just a standard theme there...
Sunday, 12. November 2006, 21:39:26
Changes in site code changed, I'll rework the CSS file on my page someday after site code is stabilized.
Thursday, 30. November 2006, 02:53:50 (edited)
Thanks
Sunday, 25. February 2007, 09:44:47
Originally posted by doppler:
Yes, this all helped. But a crash-course in CSS first did wonders as well!
Did you've seen Serbian Fighter's blog entries? --> http://my.opera.com/WhyOpera/blog/show.dml/66554 <--
Wednesday, 21. March 2007, 17:47:20
Originally posted by salmondine:
This code under the *\\menu li //* allows you to change the menu button names.
#menu_blog a { content: "New Button Name"; } #menu_friends a { content: "New Button Name"; } #menu_about a { content: "New Button Name"; } #menu_albums a { content: "Images"; } #menu_links a { content: "URL's"; }
I've tried to change the menu to my own language (but still written in Latin alphabet), but it didn't work
Wednesday, 18. April 2007, 12:16:47
Originally posted by khanhquang:
now FF available.
How? i still can't see changes in FF or Flock or IE.
It's a bit useless when changes are made only for opera as most users work with IE or FF.
Thursday, 19. April 2007, 04:24:49
Originally posted by petermanon:
Originally posted by khanhquang:
now FF available.
How? i still can't see changes in FF or Flock or IE.
It's a bit useless when changes are made only for opera as most users work with IE or FF.
I hope you can guess from this post (in Vietnamese)
http://my.opera.com/danquynh/blog/show.dml/919116
If you don't, feel free to contact me
Showing topic replies 1 - 50 of 51.
Forums » The Style Council » General » My.Opera Personalization
