This is a discussion on "[SOLVED] having a couple of div's underneath each other?" within the Web Page Design section. This forum, and the thread "[SOLVED] having a couple of div's underneath each other? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] having a couple of div's underneath each other?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] having a couple of div's underneath each other?
Hi guys and gals, I know this is simple but its been a curious one for me for some time now. See in the following code 'thischunk' I want to be on its own line. Instead both div's just append side by side because I'm a bit uneducated with css. So uneducated I tried things like 'clear: right;' cuz my silly brain says it will clear everything right of the div. Am I dumb?
Say I have the code:
Thankyou! |
|
|
|
#2
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
I put some <br />'s in between but its so not cool.
|
|
#3
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
Remove the float:left and they will go beneath each other.. Is that what you are asking?
__________________
Marc Staff Manager - Webforumz.com Want to be a moderator? PM me. |
|
#4
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
you could also place the following in between the divs:
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#5
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
Yeah, welshstew is correct.. I completely read the question and code wrong.
__________________
Marc Staff Manager - Webforumz.com Want to be a moderator? PM me. |
|
#6
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
Quote:
Applying "overflow: hidden" to an empty <div> will do absolutely nothing, because the <div> has no content to overflow. In fact, it occupies zero space. So the correct CSS for a clearing <div> is simply:
Last edited by MikeHopley; Dec 3rd, 2007 at 09:01. |
|
#7
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
Quote:
Other times it doesn't work by itself, in which case I have to add a whole heap of things that will allow it work correctly in that ever so lovely browser.
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#8
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
Most of that code is completely unnecessary. Your phantom space probably comes from margins being applied to the <div>, or to elements before it.
It's also possible that your "heap of things" is solving the problem by activating hasLayout. But you only need one property to activate hasLayout; I use "zoom: 1" (yes, I know this is invalid). IE6 follows its own rules, and I recommend isolating your IE6 hacks in a separate stylesheet. There's no need to clutter your main stylesheet with IE6 junk, and isolating the styles allows you to use invalid code with a clear conscience. |
|
#9
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
I don't have an internet ignorer, I mean explorer setup on my computer... but I'm not sure if this relates to what you guys are talking about with the overflow, but without the 'overflow: hidden' it ignored my 'margin-bottom: 3px;' and there was no space between. This was on safari and firefox. Thanks for the help everyone! Last edited by cosmicbdog; Dec 3rd, 2007 at 10:31. Reason: correctness |
|
#10
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
Quote:
No matter how dirty it might make you feel, you should get both IE6 and IE7. These browsers together account for 80% market share, so you need to make sure your website works in them. |
|
#11
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
I know I know... actually I would test with IE but they stopped even making it downloadable for the Mac. I don't get it... 'Office' is in all the stores and Bill has shares in Apple.
I had an account with browsercam.com for a while. That was a good way of checking. Luckily my sites aren't too cool and seem to look the same across the board. |
|
#12
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
also, fingers crossed the 80/20 rule applies to this. You know, 80% of your business comes from 20% of your customers? that rule? Assuming that Ie users are dimwits who don't know a computer from a calculator the 20% that make conscious choices on the web are the ones that matter anyways...
|
|
#13
|
|||
|
|||
|
Re: having a couple of div's underneath each other?
Quote:
Most of the business conducted on the web comes from people who "don't know a computer from a calculator". These people use IE. They are not stupid, just uninformed about browsers and uninterested in them. Hell, one of my best friends uses IE. He is studying for a physics Phd. in condensed matter, and he got the top undergraduate mark in his year at Oxford. Are you calling him a dimwit? He's probably more intelligent than anyone you've ever met. Sure, 80% of your business may come from 20% of your customers. But if your site breaks in IE, you will have 80% fewer customers. Which would you rather have: 20% of 20%, or 20% of 100%? That is to say, would you like to lose four out of every five sales? I understand it must be difficult testing with IE on a Mac. But you must find a way. Just like you, I enjoy excoriating IE. It eases the pain. But you have to make practical business decisions. In business, numbers always take precedence over ideologies. Last edited by MikeHopley; Dec 3rd, 2007 at 11:19. |
|
#14
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
Ignore the below, just seen Mikes post that you are on a mac - sorry.
Stew you can download a VPC of either IE6 or IE7 9depending which one you have on your PC from here Another option is to have a look at multiple IE
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#15
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|
|
#16
|
||||
|
||||
|
Re: having a couple of div's underneath each other?
Mike,
Quote:
I may start another thread about this if I have time. Thanks for the advice.
__________________
WelshStew If you think I've helped, click the "Thanks" tierney rides tboard - uk site | xtreme wales - extreme clothing WebForumz - facebook | LinkedIn
Last Blog Entry: Phorm approved for UK rollout (Sep 17th, 2008)
|