html - Same relative width in fixed header and content -


please find code here: https://jsfiddle.net/5jv8m5xf/

the code above consists of fixed header , content.

i want fixed header , content have same relative width (%). therefore, put width: 80%; both of them. however, can see in jsfiddle fixed header has bigger width content.

when put fixed width (px) example width: 500px; both of them have same width. however, want them have same relative width (%) make layout responsive.

what have change in code achieve this?

default browser styles add 8px of margin <body> element.

those offsetting .content, won't effect .header, because it's fixed.

add align elements:

body {   margin: 0; } 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -