• 0

CSS Problem


Question

I'm having a slight problem with CSS and browser compatibility. Basically, I have a main div box and several sub-boxes. The main div box has a min-height of 100px (meaning that it will be at least 100px tall, unless the content inside the box causes it to stretch vertically), and there is a sub-DIV box that is floated to the left. This sub-DIV box I want to have a min-height as well, so there isn't a gap between this sub-box and the bottom of the main DIV box.

Here is the code that I am using. I am fairly new to CSS, so there may be more efficient ways of doing things. Can someone give me a pointer to how I can fix this design flaw?

<div style="width: 560px; min-height: 100px; border: 1px solid #000000; background: #ffffff; z-index: 1; padding: 0px">
	<div style="width: 100%; height: 20px; padding: 0px; margin: 0px; border-bottom: 1px solid #000000; background: #613520">
		&lt;div style="float: left; height: 20px; width: 20px; border-right: 1px solid #000000; margin: 0px"&gt;&lt;img src="https://www.venture50.com/downloads/images/icons/package.jpg"></div>lt;div style="width: 20px; height: 20px; float: left; border-right: 1px solid #000000; margin: 0px"&gt;&lt;img src="https://www.venture50.com/downloads/images/icons/food.jpg"></div>lt;div style="width: 350px; height: 20px; float: left; border-right: 1px solid #000000; margin: 0px; background: #a17e54; line-height:20px; padding-left: 3px"&gt;Business Name&lt;/div&gt;
		&lt;div style="width: 161px; height: 20px; float: left; margin: 0px; background: #613520; line-height:20px; padding-left: 3px"&gt;Business Type&lt;/div&gt;
	&lt;/div&gt;

	&lt;div style="width: 210px; z-index: 1; min-height: 79px; float: left;display: inline; background: #ebe2d9; border-right: 1px solid #000000"&gt;
		Line of Text&lt;br /&gt;Line of Text&lt;br /&gt;Line of Text&lt;br /&gt;Line of Text&lt;br /&gt;Line of Text&lt;br /&gt;
	&lt;/div&gt;
	Some more text to the right...

&lt;/div&gt;

How it looks in Firefox and Safari (not working right):

post-14932-1134796081.png

How it looks like in IE (how it is supposed to look):

post-14932-1134796089.png

Thanks!

Link to comment
https://www.neowin.net/forum/topic/409122-css-problem/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

i know there are issues with min-width in some browsers, but you should check out both

www.positioniseverything.net and

www.quirksmode.org

both sites have great info on browser compatibility in web design.

if your general goal however is just to have two columns of equal length, there are more effective ways to do so, with or without the use of 'faux columns'. Here's an ALA article:

http://www.alistapart.com/articles/fauxcolumns/

Avoiding faux columns means either using negative margins, as in this article:

http://positioniseverything.net/articles/o...out/equalheight

...or proper use of the 'height: 100%' rule. however, it would require you to know the height of the containing div, which i don't think you can in your case

Link to comment
https://www.neowin.net/forum/topic/409122-css-problem/#findComment-586932726
Share on other sites

  • 0

Works for me in FireFox 1.5.

I had to remove, border-bottom:white etc.. from the second div to get the border working right.. otherwise all good. :\ (I don't have a doctype though, perhaps thats it?)

Otherwise... throw in some <br style="clear:both" />'s after some of your floats to see if that helps. (usually works, but I'm not quite sure why :p)

Link to comment
https://www.neowin.net/forum/topic/409122-css-problem/#findComment-586933081
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • That’s why I love classic Notepad from W10 IOT LTSC. It opens up instantly, uses very little resources, is just a plain notepad and nothing more. the title should be notepad has lost focus.
    • Seeing my profile picture in Notepad creeped me out. I do not appreciate that Copilot is opt-out rather than opt-in. I don't want Notepad to have connectivity. The other improvements are fine, including the upcoming Markdown support (although I hate Markdown's handling of newlines with a passion).
    • More like Trelane: https://memory-alpha.fandom.com/wiki/Trelane But, yes, Q.  
    • This would come in handy to me as an Uber driver. My biggest pet peeve is when passengers listen to their own audio on their phones without using headphones when they can hear I'm already playing music through my car's head unit.
    • Astonishing new tech could kill headphones forever as it bends sound right into ears by Sayan Sen Imagine being able to listen to your favorite song or podcast out loud without disturbing anyone nearby even without wearing headphones. That’s what a team at Penn State University has been working on. Led by acoustics professor Yun Jing, they’ve come up with a clever way to create invisible audio zones called “audible enclaves” where sound can be heard only at one exact spot. They use ultrasound, which is normally inaudible to people, along with something called acoustic metasurfaces—tiny lenses that can bend sound in specific directions. By combining two ultrasound beams that travel in curved paths and meet at a single point, they’re able to make sound audible only at that intersection. As Jing explained, “The person standing at that point can hear sound, while anyone standing nearby would not. This creates a privacy barrier between people for private listening.” To make this happen, the system includes two ultrasonic speakers and the metasurface lenses, which were 3D printed by Xiaoxing Xia from Lawrence Livermore National Lab. Each beam has a slightly different frequency, and when they meet, a local reaction makes the sound audible. Neither beam is loud on its own—the sound only forms at that shared point. Jia-Xin “Jay” Zhong, one of the researchers, shared how they tested the idea: “We used a simulated head and torso dummy with microphones inside its ears to mimic what a human being hears at points along the ultrasonic beam trajectory, as well as a third microphone to scan the area of intersection. We confirmed that sound was not audible except at the point of intersection, which creates what we call an enclave.” One of the biggest advantages of their approach is that it works across a wide range of sound frequencies—between 125 Hz and 4 kHz, which covers most of what people can hears. Even in rooms where sound usually bounces around, their system held up well. And it’s surprisingly compact too: the whole setup measures about 16 centimeters, roughly the size of a pencil case. “We essentially created a virtual headset,” Zhong said. In practice, it means that someone standing in the audible enclave can hear what’s being played clearly, while everyone else around hears nothing at all. That could be especially useful in shared spaces like cars, classrooms, or open offices. Right now, the sound can travel about one meter and hits around 60 decibels which is similar to regular talking volume. The team believes they can push those limits further by using stronger ultrasound. All this might seem futuristic, but it’s grounded in solving a basic problem: how to direct sound only where it’s needed. If you’re into tech and sound design, this could open up a whole new world of personalized audio experiences. Source: Penn State, PNAS | Image via Depositphotos This article was generated with some help from AI and reviewed by an editor. Under Section 107 of the Copyright Act 1976, this material is used for the purpose of news reporting. Fair use is a use permitted by copyright statute that might otherwise be infringing.
  • Recent Achievements

    • First Post
      leoniDAM earned a badge
      First Post
    • Reacting Well
      Ian_ earned a badge
      Reacting Well
    • One Month Later
      Ian_ earned a badge
      One Month Later
    • Dedicated
      MacDaddyAz earned a badge
      Dedicated
    • Explorer
      cekicen went up a rank
      Explorer
  • Popular Contributors

    1. 1
      +primortal
      504
    2. 2
      ATLien_0
      211
    3. 3
      Michael Scrip
      197
    4. 4
      Xenon
      149
    5. 5
      +FloatingFatMan
      125
  • Tell a friend

    Love Neowin? Tell a friend!