interesting css override

Website No Comments »

so while messing with the style of this theme to change a few things, I ran into an interesting thing about CSS - Overrides. More specifically, proximity vs. id/class. In essence, even though I was specifying a closer proximity to the element via it’s outer class, because there was an element with an id with the same style, even though it was higher up the chain, it was overriding my style.

If you understood that, congrats, because I just wrote it and I don’t understand it. So I’ll try and go a little more indepth here. If you don’t care about CSS and web design, please, feel free to disregard this post.

So the sidebar ( the vertical bar over there –> ) has an id of #sidebar and it has a style for all the links. Now, there is the calendar ( which is also over there –> ) which has a class defined of widget_calendar. I wanted to change the style of the links within the calendar. So, using proximity, I said something like this…

li.widget_calendar a {
   text-decoration: underline;
}

Now here’s the rub. Since the sidebar is specified with an id and there can only be one id of that name within the page, that’s considered closer proximity than the fact that I specified a style for a class, assigned to element within the sidebar element. So, in order to fix this, I had to change the style to something that had an id tag and was inside the sidebar element. Lucky for me, the calendar also generates a div with a specific id. I was able to use that to assign my link style.

Confusing, I know. CSS is a love/hate relationship with me. There are so many cool things you can do to style your pages but some of it is so baffling and irritating ( especially with cross browsers ) that it becomes a nightmare.

In any case, the problem has been solved and I now, joyously, have underlined links in my calendar. Yay!

More fun and back on track.

Friends, Health, P90X, Work 1 Comment »

So you may have noticed that the theme on this site kept changing. The basic reason being that I couldn’t find a damn theme that I was entirely happy with. Redoable was nice, but had bugs due to it no longer being developed. I fixed a few but more just seemed to keep popping up. Hemingway had it’s issues, as did Foilage. I went back to Emire, which has no bugs, but I had that theme for a lonnnnnnnnnnnng time. Finally, I found this one, called dreamplace. I think it looks cool, it doesn’t have any bugs, scales well and has the calendar that I wanted, although it doesn’t highlight the days, which is something I’ll have to fix.

As for other things, I finished my first week of P90X ( again ). Thanks to all who have left comments, I really appreciate them. I ended up missing Friday due to work issues ( I had to go in at 4 AM, left at 2 and fell asleep ), so I did Legs and Back on Saturday and Kenpo today and I’ve got Chest and Back tomorrow. I’m down to 190 lbs and 20% body fat at the moment, so from here I’ll start the blog pages back up again. Everyone is alot further ahead of me in the program, which sucks but at least it keeps the motivation going for me.

I totally flailed on my challenges with the Tiger, due to my sickness and recent work issues. I won’t be making my goals either, so I’ll have to reset them. At least I got the Tiger running though and hopefully we can start another BeerChan challenge back up.

Anyways, I have to head off to go bowling in a sec ( no more beer. :( ), but keep checking the site for more updates!