if overflow
is an option (which i feel makes your life easy here), here is a demo
Keeping HTML same, your css (2 line changes) below
.boxA {
width: 220px;
padding: 0px 3px 5px 5px;
float: left;
height: 100%;
margin-bottom: 0px;
border: solid 1px green;
overflow:hidden; /*added this*/
}
.boxB {
width: 420px;
padding: 0px 5px 5px 3px;
float: right;
height: 100%;
border: solid 1px red;
overflow:hidden;/*added this*/
}