A div has a tilable background. The height of this div will depend on its content. I need the div to stretch by a multiple of the background image's size.
For instance, the background is a 64x64 image. So, if the div's height is to increase, I want to do so by steps of 64px.
Is this possible with CSS? I've not found leads using google. Thanks for your time!
Syntax: To set a div element height to 100% of the browser window, it can simply use the following property of CSS: height:100vh; Example: HTML.
The two or more different div of same height can be put side-by-side using CSS. Use CSS property to set the height and width of div and use display property to place div in side-by-side format. The used display property are listed below: display:table; This property is used for elements (div) which behaves like table.
To my knowledge this cannot be done in CSS, but you could probably solve it with some javascript. If you have access to jQuery:
$(function() {
$div = $('#the_div_id');
var remainder = $div.height() % 64;
var newHeight = $div.height() + (64-remainder);
$div.css('height', newHeight);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With