Wednesday, 15 July 2015

css - Three divs side by side with inner div width 100% -



css - Three divs side by side with inner div width 100% -

the 2 outer divs needs remain specific size center div needs fit space between outer divs. can point me in right direction

here's 1 uses previous mentioned html, though jquery gather widths of 2 side divs , subtract widths container, assign center div. assumed needed not percentage widths, or else assign them that. calculated widths of left , right in chance wanted create 1 different size. isn't responsive either, calculates on page load, if re-size screen break.

$(document).ready(function () { var contwidth = $('#container').width(); var leftwidth = $('.left').width(); var rightwidth = $('.right').width(); var finalwidth = contwidth - leftwidth - rightwidth; $('.content').width(finalwidth); });

here's pen

css html5

No comments:

Post a Comment