How to: CSS trick to overcome border problem in dynamic height columns

One of my colleague today, came out with one solution of giving border to different height columns.

The problem

If you have two different div’s one after other (float left) and either of them have different height or dynamic height , it is impossible to give border left or right to the tallest one.

Look at the figure:

The Solution

Rather giving borders to these div , concentrate on container having them. That means give background image to the container. Just use below line in css:

1
#container{background:#fff url(/images/border.gif) 400px 30px repeat-y;}

and here is the solution:

That’s it. You can adjust background image x(400) and y(30) positions as your design requirements.

Your comments are valuable please let me know if I have to refine it more.

Recently Published

»

What Really Makes a Website User-Friendly

Whether it’s for business or personal use, having a website online ...

»

5 Features of Virtual Private Server that put you in complete Control of Your Website

For a decade now, virtual private server has been a preferred hosting ...

»

8 Ways the Right Ecommerce Platform Makes Your Business Perform Better

Starting your own ecommerce store is an exciting experience, but ...

»

The SSL certificates and why are they essential for sites

What are SSL and its purpose? SSL is a modern technology that is ...

»

Entering Into M-Commerce as a Small Business

According to a December 2016 Business Insider article, the U.S. ...

»

How to Convert More Traffic Quickly and Easily

If you’ve got a blog that gets plenty of traffic but ...

»

Strengthen Workplace Productivity with Live Chat Software

Live chat has become an important part of every company’s customer ...

»

How More Powerful Smartphones Are Making Websites Load Faster

Smartphone speeds keep accelerating. Last October, Qualcomm joined ...

»

The Most Effective Method To Present A Logo Plan

The Most well-known creators’ battles are and how they are ...