简体   繁体   中英

Automatic Body Re-Size

I'm trying to make it so that the body width automatically resizes according to how many boxes are in the site. I'm also trying to make it so that the boxes are all aligned side by side while it scrolls horizontally. I've tried to do it here: http://flaming-prince.tumblr.com/ is there any way to do what i'm thinking using java script? or any form of html?

Remove the set width from your body tag, and add white-space: nowrap to #posts .

#posts {
  white-space: nowrap;
}

This prevents content inside of #posts from wrapping to the next line, unless there is a <br> tag. This works in all major browsers and IE7+.

Then add this to prevent the children of #posts from inheriting nowrap :

.post {
  white-space: normal;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM