wordpress - CSS Responsive comlumns - aligning text -
i can't seem able align text 2 columns next each other. first column has text while second column has image , text below reason falls under different line height , not in balance text on left.
best explained seeing relevant code below... http://goo.gl/jmq1ui
when resize browser make smaller, text gets aligned. how can make aligned?
.one_half { float:left; line-height:22px; margin-right:2%; width:49%; margin-bottom:27px; display:block } .one_half_last { float:left; line-height:22px; width:49%; margin-bottom:27px; display:block }
you need size things things vertically in terms of typographic scale (imagine horizontal lines spaced evenly aligned baseline of every line of text). in case, paragraph line height 22px. we'll use our scale , size vertically based on that:
make margin below paragraphs equal line height:
p { line-height: 22px; margin-bottom: 22px; <---- 20px }
make sure image's height (or of container) equal multiple of line height (i.e.: 22px).
img.aligncenter.size-full.wp-image-2803 { height: 396px; <------- 18*22, closest natural rendered height }
caveat: works if columns fixed-widths, can make image exact height @ each media-query break point. if columns percentage based, , can vary @ window width, unfortunately you're going have hard time getting text align everywhere.
a common typographical trick make right column narrower , render paragraph format differently (ie.: maybe tighter line spacing, smaller font size, heavier weight, etc.). 2 things: removes alignment problem altogether, , can give sense of hierarchy 2 columns (i.e.: left column primary, right secondary), may or may not suit needs.
Comments
Post a Comment