Floating div positioning

. I need a floating rectangle (100% width, 100px height) to appear exactly 20px above the bottom of a page. How can I do that? The code below shows the rectangle at the bottom of the browser window not the page – so if the page is taller than what can fit in the screen, … Read more

How do I change the background color with JavaScript?

Modify the JavaScript property document.body.style.background. For example: Note: this does depend a bit on how your page is put together, for example if you’re using a DIV container with a different background colour you will need to modify the background colour of that instead of the document body.

CSS Font Border?

There’s an experimental CSS property called text-stroke, supported on some browsers behind a -webkit prefix.  Run code snippetExpand snippet Another possible trick would be to use four shadows, one pixel each on all directions, using property text-shadow:  Run code snippetExpand snippet But it would get blurred for more than 1 pixel thickness.

Creating a nav bar with flexbox

I’ve been learning code only for a couple of weeks, so I have a very basic knowledge. I got stuck trying to build a navbar using flexbox. For some reason I can’t get my nav buttons () to stand in a horizontal way. I’ve been trying and rewritting my code, but I can’t figure it … Read more

Should you use rgba(0, 0, 0, 0) or rgba(255, 255, 255, 0) for transparency in CSS?

The last parameter to the rgba() function is the “alpha” or “opacity” parameter. If you set it to 0 it will mean “completely transparent”, and the first three parameters (the red, green, and blue channels) won’t matter because you won’t be able to see the color anyway. With that in mind, I would choose rgba(0, 0, 0, 0) because: it’s less typing, it keeps a … Read more

Transparent CSS background color

now you can use rgba in CSS properties like this: 0.5 is the transparency, change the values according to your design. Live demo http://jsfiddle.net/EeAaB/ more info http://css-tricks.com/rgba-browser-support/

How to style a checkbox using CSS

UPDATE: The below answer references the state of things before widespread availability of CSS 3. In modern browsers (including Internet Explorer 9 and later) it is more straightforward to create checkbox replacements with your preferred styling, without using JavaScript. Here are some useful links: Creating Custom Form Checkboxes with Just CSS Easy CSS Checkbox Generator Stuff … Read more