Ever need a list which you can easily show/hide the content? Check out: http://cssglobe.com/post.asp?id=940
Posts Tagged ‘CSS’
All posts tagged CSS.
Using !important With CSS
I am not a “quick fix” or “work around” type of person. When a CSS debugging project comes my way I look first at fixing the problem systemically vs. applying the quick fix. Recently though I was brought into a project with an insane amount of CSS and conflicting styles all over the place. Since I did not have ample time to fix the issues systemically (this was a super stat job) I was forced to use something that would take precedence over the problematic styles already in place to quickly fix the issues.
If you have worked with CSS before I am sure you have seen “!important” used but probably were not really sure what it was. I ended up using a “fixes.css” style sheet which was called in after all the other style sheets and then using “!important” with the styles I needed to correct (override). This was very helpful and if you ever run into a similar situation or have a certain style that you cannot seem to figure out why something is not showing up (“I set this to have a margin-bottom:20px; but there is no margin at all”) try putting in the !important (margin-bottom:20px !important;) and see if that helps.
More information on !important: http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order
Simple 3 Column Layout
I was talking to one of my friends today who does a lot backend programming but often needs a quick and easy 3 column layout that has the floats all figured out. His frustration with floats prompted me to make a very basic layout for him to use. If you find yourself in the same situation – check out my basic 3 column layout.
Always Use a Doctype
After spending an hour on something that should have taken me 20 minutes – I wanted to pass on something I should have caught right away. The problem: you use CSS to lay something out and it looks great in Firefox and Safari – but not in IE. At this point I validate the CSS to make sure I did not forget a bracket or something stupid. Next step – validate the XHTML. This is where I would have solved my problem, but I failed to take this step. At that point I would have seen that the script I was working with did not have a doctype defined. Once I added in the doctype – everything loaded as expected and I could not believe I missed something so basic. Lesson learned – and hopefully you will know now as well to make sure a doctype is always set.
Add a "Pseudo" Pseudo Class Hover in Inline CSS.
I have been busy this week with a few really cool projects – one of them to create a widget for any site that will show the latest news items from a RSS feed – while not limiting the widget to servers with PHP. After putting that together, I had to add inline CSS to style the feed output. Everything looked great but I could not figure out how to add a :hover to an inline style…until I realized I could fake it by adding some basic javascript: onmouseover and onmouseout to change the font color.
<a href="file.html">Title</a
Quick and Easy CSS Layout: YUI CSS Grid Builder
If you are not comfortable with CSS or want to get a layout together really quick – check out the YUI CSS Grid Builder. You can easily create a layout, add content, and get the code in a matter of minutes. At the very least – this is a great starting point for beginners! Check it out!
Swamped, But Big Things to Come
I apologize for not blogging as much as I would like over the last few weeks, but I have been swamped with a number of big projects. As soon as I have more than five minutes at one time to blog – I have a great blog post to write on some really cool stuff I have been doing with CSS. Stay tuned!
CSS Checker
What do you do when you have thousands of lines of CSS and probably have hundreds of lines within the thousands that are no longer used…but you have no idea because multiple people have contributed? You use the CSS Redundancy Checker.
