How to make a div 100% height of the browser window

There are a couple of CSS 3 measurement units called: Viewport-Percentage (or Viewport-Relative) Lengths What are Viewport-Percentage Lengths? From the linked W3 Candidate Recommendation above: The viewport-percentage lengths are relative to the size of the initial containing block. When the height or width of the initial containing block is changed, they are scaled accordingly. These units are vh (viewport … Read more

Table fixed header and scrollable body

Fixed table head – CSS-only Simply position: sticky; top: 0; your th elements. (Chrome, FF, Edge) For both sticky vertical TH and horizontal TH columns (inside TBODY): TH borders problem fix Since border cannot be painted properly on a translated TH element, to recreate and render “borders” use the box-shadow property: Fixed table head – using JS. (IE) You can use a bit of JS and translateY the th elements jQuery example Or plain … Read more

Set cellpadding and cellspacing in CSS?

Basics For controlling “cellpadding” in CSS, you can simply use padding on table cells. E.g. for 10px of “cellpadding”: For “cellspacing”, you can apply the border-spacing CSS property to your table. E.g. for 10px of “cellspacing”: This property will even allow separate horizontal and vertical spacing, something you couldn’t do with old-school “cellspacing”. Issues in … Read more

How to use PHP inside css file

If you’re able to rename your CSS file “layout.php”, there’s no need for all of these workarounds: Your layout.php file would look like: Your HTML files would look like: This question is very similar: Include: css with php file extension?

Best HTML5 markup for sidebar

First of all ASIDE is to be used only to denote related content to main content, not for a generic sidebar. Second, one aside for each sidebar only You will have only one aside for each sidebar. Elements of a sidebar are divs or sections inside a aside. I would go with Option 1: Aside … Read more

body background color not showing?

Comment your Bootstrap include and see if the body is applied. You should try to test with the minimal amount of code first and then add in things. If that doesn’t work, you can use an inspector in Firefox or Chrome to see what CSS effects are applied. You also may want to use the … Read more