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 |
|
|||
|
[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! |
|
|
|
|||
|
Re: having a couple of div's underneath each other?
I put some <br />'s in between but its so not cool.
|
|
||||
|
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?
|
|
||||
|
Re: having a couple of div's underneath each other?
you could also place the following in between the divs:
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
Re: having a couple of div's underneath each other?
Yeah, welshstew is correct.. I completely read the question and code wrong.
|
|
|||
|
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. |
|
||||
|
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 Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
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...
|
|
|||
|
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. |
|
||||
|
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 Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
Re: having a couple of div's underneath each other?
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
||||
|
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 Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
|
|||
|
Re: having a couple of div's underneath each other?
Following a similar logic that we conform to fit in with the monopoly, why are we speaking english and not mandarin? I mean, there'll be more mandarin speaking people with Phd's then the whole population of UK within a couple years... why bother with english? You also are missing out on 4 out of 5 sales.
|
|
||||
|
Re: having a couple of div's underneath each other?
Because, as you say: within a couple of years - not yet!
|
|
|||
|
Re: having a couple of div's underneath each other?
Quote:
If my current project is successful, I intend to have it translated into Chinese/mandarin/whatever, because my largest potential market is in China. But while hacking for IE can be tough, it's not nearly as tough as learning to speak fluent Mandarin; and translation is not cheap. Still, I may be able to call on friends to translate for me, in return for a slice of the profits. Moreover, we're fortunate that English is the de facto standard for international business. Once again, practical concerns beat foolish ideologies every time. If you believe whatever you want to believe, you'll be a loser. Winners observe what really happens, and act accordingly. Last edited by MikeHopley; Dec 3rd, 2007 at 11:38. |
|
||||
|
Re: having a couple of div's underneath each other?
Quote:
And if you build your site with a server side code you could add a mandarin language option.
__________________
WelshStew Lead Administrator tierney rides tboard - uk site | xtreme wales - extreme clothing If you think I've helped, click the "Thanks" webforumz - facebook | LinkedIn
Last Blog Entry: Web Standards Curriculum Launched (Jul 8th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Trouble hiding/showing DIV's | recreant | JavaScript Forum | 5 | Dec 3rd, 2007 05:57 |
| [SOLVED] using background images to fill div's | R8515198 | Web Page Design | 9 | Sep 29th, 2007 21:05 |
| Vertically centering Div's | verkevinmanering69err455 | Web Page Design | 3 | Mar 19th, 2007 17:22 |
| Div's tags in IE = death | verkevinmanering69err455 | Website Planning | 2 | Mar 12th, 2007 04:43 |
| Div's overlapping | fluerasa | Web Page Design | 2 | Oct 8th, 2006 10:09 |