beennn Posted June 21, 2013 Share Posted June 21, 2013 (edited) I'm having some trouble getting multiple divs floating next to each other. Here's what I have so far: .content { width:auto;max-width:100%;float:left;padding:15px;} which gives: However I'm aiming for: Any ideas? Edited June 21, 2013 by beennn Link to comment Share on other sites More sharing options...
niche Posted June 21, 2013 Share Posted June 21, 2013 Depends on what you're using for content. This works: <!DOCTYPE html><html><head><style>.content {width:auto;max-width:100%;float:left;padding:15px;background-color:yellow;}</style></head><body><div class="content"><p>Some text.</p></div><div class="content"><p>Some text</p></div></body></html> Link to comment Share on other sites More sharing options...
beennn Posted June 21, 2013 Author Share Posted June 21, 2013 Aah, thank you. The div which the content div was in had a margin which was causing it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now