0

My layout is responsive, but if I change the size of the page it gets all messy. I wonder how do I put a min-width on my body. so that the page can be resize to eg 500px wide.

PS:

I try set

body {
    min-width:400px;
}

but no work

I use bootstrap

The problem is when I go to change the size of my window (page). when I leave the width very small components are misaligned.

2
  • put min-width on the body? Commented Jun 11, 2013 at 20:47
  • no have effect, i use bootstrap, it has influence? Commented Jun 11, 2013 at 20:48

3 Answers 3

1

You need to inspect the element with chrome/FF dev tools and make sure that bootsrap styling is not overriding your style. You can also try this:

 body {
    min-width:400px !important;
}

if that works, it means bootsrap is overriding the style.

Sign up to request clarification or add additional context in comments.

2 Comments

I can block resize of my page ?
blocking resize all together is not a good idea, and also neglets the need for responsive design. you can limit the minimum size that fits your goals (i.e. doesn't break the layout) by setting the min-width, play with the site and see at what size it breaks and that is your limit.
0

You can't really control the width of the <body> element, since it must fill the browser window. Try wrapping your content in a <div> with a min width.

1 Comment

That is not true, you can set the body width same as every other element
0

Either your can give parent div for the layout with fixed width, then scroll bars comes if reduces the browser size, There won't be any mess.

it won't be no use controlling body width

another way give percentage value for the width size to maintain the layout structure

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.