2 replies [Last post]
kevd10
kevd10's picture
Offline
newbie
Last seen: 6 years 20 weeks ago
Joined: 2014-02-13
Posts: 2
Points: 3

I have a small section which I would like to have a border around. Problem is, everytime I try to add a border, the 2 side by side divs become one on top of the other. The url is http://www.italiaknow.co.uk/item/poocinis/.

The first section ('Address' to 'Web') is where I want it, then the section below that ('Hours Open') should be alongside the first section, and was until I added the border.

Any help would be much appreciated.

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 2 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5343
Points: 2964

Hi kevd10, Here is 2 ways you

Hi kevd10,
Here is 2 ways you can get around this:
1) Whatever width of border you use remove that value (both sides added together) from the margin, then there should be no change to the position of the floats.
2) use box-sizing:border-box; box-sizing

kevd10
kevd10's picture
Offline
newbie
Last seen: 6 years 20 weeks ago
Joined: 2014-02-13
Posts: 2
Points: 3

Hi! The first option worked,

Hi!

The first option worked, but would not allow me to have any space whatsoever between the border and the content. The 2nd option did not work at all.