html - Whitespace of unknown nature occured. Fixed-height -
i decided start hand-coding rather using frameworks. though seemed quite fine, collided problem of whitespace of uknown origin me.
got test site can inspect elements.
the problem
here's screenshot of problem. space between blue area marked dev tools , "our portfolio" slogan.
in template psd file section 1 occupies 568 pixels, so, assuming want pixel-perfect style, set 568px height .section-1
element
.section-1{ height: 568px; }
and though dev tools tell it's height 568 pixels, section followed , preceeded kind of whitespace of utterly unknown nature.
i don't wanna using workaround like
.section-1{ margin-bottom: -140px; }
but know what's wrong markup , styles produce whitespace.
update
the issue collapsing margins , chrome's , other's browsers' default styles.
you fell in trap called collapsing margins. it's defined, rather unknown behaviour. if know it, can useful.
the margin-top
.section-header
spills over. if change margin padding , add margin-top: 0;
, additional whitespace gone.
Comments
Post a Comment