Latest News & Articles On CSS 3
SELECT OPTIONS FROM BELOW:RSS-feed will be listed here...
CategoriesClick the categories below
Ref: http://stylishwebdesigner.com/70-must-see-css3-tips-tricks-and-tutorials/
1. Avoid CSS hacks, use future proof methodWe should avoid using hacks unless there are no other ways to fix it. Because, we will not able to know when those hacks will stop working. The most common way to tackle with different version of IEs is using the if else statement: <!--[If IE 5]> 2. Use group selectorUsing group selector is a good practise to minimize your coding effort and also save a few bytes out of your stylesheet. We can group the selector to avoid repeating declaring the same properties for different elements h1, h2, h3, h4, h5, h6 { 3. Center elementsIt's easy to center an element, for firefox and safari, we only need to specify the width and margin left and right set to auto. However, you will need to specify text-align to center in the parent element for IE. body { 4. CSS PositioningThis is something I've just discovered it few weeks ago. Set the abolute position within a container. #item will appear inside the #container exactly 200px from the left and 50px from the top. #container { 5. Text transformThis is something I discovered long time ago, CSS has the ability to transform text to lowercase, uppercase and capitalized the first character of a word. w3schools CSS - Text transform h1 { 6. Remove links or textbox hightlight borderWhen you click on textbox or link, you will able to see a border highlighting the element. It's even more obvious if you are using mac os. Luckily, you can solve it using outline property. I used it when I set the indentation of a link text to -999em and also when I'm building a textfield with rounded border. a, input {
7. Hidden textI think the correct way to do it is using text-indent. And also, you'd want to apply outline:none to hide the border. We use hidden text when we're using images to replace text but we want to make sure search engine can crawl the keyword. a {
8. Keep consistent with SUP and SUBI have a chance to work on one website that uses ® and ™ massively (bad... bad experience). The problem I was facing is, the sup and sub being rendered differently in different browsers, so, I found this and it solved my problem. Adobe Advisor / CSS sup, 9. CSS Transparency Setting for all browsersYes, I can never able to remember it, so I guess it's a must to list it out here for future reference. .transparent_class { 10. PNG Fix for IE6Yes, this is the best thing ever to fix ie6 annoying short coming (it doesn't work with background-position). However, if you want a better solution to could fix all the png images in your css files, you can try this IE PNG Fix from twinhelix and the new version support background position! .png_hack{ 11. Prevent line breakThis is a simple css tips, but some of us might not know about it. It forces the text display in one line. h1{ 12. Force page breaks when printing your documentWhen you're creating a printer friendly webpages, you want to know about these property. More about printing CSS property, visit W3C CSS Print Reference and also the CSS3 stardard h1{ 13. Remove vertical textarea scollbar in IERemember that annoying textarea scrollbar that display by default in IE? Yes, we can remove it. textarea{ 14. 3D push button effectYou can create a 3D button effect easily using CSS. The most important thing is the border, set light color on top and left border, and dark color on bottom and left (shadow). a { 15. CSS TooltipsSo, you must be thinking, we will need javascript to make tooltips! :) I got this trick from Kollermedia. a:hover { 16. CSS links sequenceApparently, the sequence of the links is very important, read more. Honestly, I don't use this much, but hey, good for future reference! :) a:link { 17. CSS Shorthands!Last but not least, here are the CSS shorthands that will make our life easier! /* MARGIN */
Ref: http://www.queness.com/post/402/15-css-tips-and-tricks
|