css


How do negative margins in CSS work and why is (margin-top:-5 != margin-bottom:5)?

Negative margins are valid in css and understanding their (compliant) behaviour is mainly based on the box model and margin collapsing. While certain scenarios are more complex, a lot of common mista... Read More


css - prevent :after element from wrapping to next line

JSFiddle - http://jsfiddle.net/Bk38F/65/ Add a negative margin to the pseudo element, to compensate its width: ul li.completed a:after { background:transparent url(img1.png) no-repeat; conte... Read More


html - Styling text input caret

'Caret' is the word you are looking for. I do believe though, that it is part of the browsers design, and not within the grasp of css. However, here is an interesting write up on simulating a caret c... Read More


javascript - Make anchor link go some pixels above where it's linked to

window.addEventListener("hashchange", function () { window.scrollTo(window.scrollX, window.scrollY - 100); }); This will allow the browser to do the work of jumping to the anchor for us and then... Read More


Why The W3C CSS Validation Service is showing Value Error : font / is not a font-family value : 11px / 14px "Trebuchet MS",sans-serif

This seems to be a bug that just crept in into the W3C CSS Validator. It has been reported on the validator’s discussion list: http://lists.w3.org/Archives/Public/www-validator-css/2012May/0003.html... Read More


html - Textarea height: 100%

Height of an element is relative to its parent. Thus, if you want to make expand your element into the whole height of the viewport, you need to apply your CSS to html and body as well (the parent el... Read More


javascript - HTML table with fixed headers and a fixed column?

Working example of link posted by pranav: http://jsbin.com/nolanole/1/edit?html,js,output FYI: Tested in IE 6, 7, & 8 (compatibility mode on or off), FF 3 & 3.5, Chrome 2. Not screen-reader-friendly... Read More


sass - Converts scss to css

If you click on the title CSS (SCSS) in CodePen (don't change the pre-processor with the gear) it will switch to the compiled CSS view.... Read More


html - CSS "and" selector - Can I select elements that have multiple classes?

You use both ( without space between them ) .checked.featured{ // ... } Reference: http://www.w3.org/TR/selectors/#class-html Example div{margin:1em;padding:1em;} .checked{color:green;} .feature... Read More


css - CSS3 property webkit-overflow-scrolling:touch ERROR

As @relluf pointed out, applying 3D transitions on the relative element fixes the bug. However, I investigated it a bit further and it seems that applying -webkit-transform: translateZ(0px) works too... Read More