Techagesite
Techagesite

Reputation: 475

Css div border going around everything not just its contents

I have an issue with the border-radius of div container2 for the links list with the resolutions at the top of the page like 240x320 etc. Its going around everything instead of just left-column2 and right-column2. Container2 is used a second time in the code without issue so i don't understand it.

At first i thought it was a problem with a closing tag but checked the code and everything is fine.

Heres my fiddle. Hopefully someone knows whats going on with it.

Upvotes: 0

Views: 206

Answers (2)

Techagesite
Techagesite

Reputation: 475

It was pointed out that i had mistaken an open div for a closed div. Thats why i was having issues with the border.

Upvotes: 0

G-Cyrillus
G-Cyrillus

Reputation: 105893

Maybe it has to do with the box-model . width + padding.

To include padding into width and use width:100% on child , you can switch the box model with box-sizing: DEMO

.container1,
.container2 {
box-sizing:border-box;/* add prefixed rules if needed */
}

SEE: W3C

Upvotes: 1

Related Questions