davidkelleher
davidkelleher

Reputation: 5338

How can I get two <div>'s closer together?

enter image description hereSee image attached - I want to bring the 'left' and 'right' 's closer together so they remain as close as both are to the header, in blue above.

this is my CSS for both left and right 's ... thank's a lot!

.left {
    float: left;
    position: relative;
    background-color: #DDFF00;
    margin-top: 40px;
    margin-bottom: 10px;
    height: 500px;
    width: 10%;
}

.right {
    float: right;
    position: relative;
    background-color: #FFE6E6;
    margin-top: 40px;
    margin-bottom: 10px;
    margin-left: 10px;
    height: 500px;
    width: 88%;
}

Upvotes: 0

Views: 8082

Answers (1)

Ju-v
Ju-v

Reputation: 362

.left {
    float: left;
    position: relative;
    background-color: #DDFF00;
    margin-top: 40px;
    margin-bottom: 10px;
    height: 500px;
    width: 10%;
}

.right {
    float: right; /*<-change to left */
    position: relative;
    background-color: #FFE6E6;
    margin-top: 40px;
    margin-bottom: 10px;
    margin-left: 10px; /*<-and play with that too*/
    height: 500px;
    width: 88%; /*<-or increase that, without any changes above */
}

Upvotes: 1

Related Questions