473,796 Members | 2,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Clearing only the last DIV

LB
Apologies if this sounds like a very newbie question.

I'm putting together a 3 column layout at the moment, the left 2 columns
are effectively menus and the third one is the 'content'.

Now, the content within the third column is brought in via a database,
and the problem I'm having is if an image file is 'taller' than the
text, the following article also wraps around the image. What I would
like to do is have that article, and its image, completely seperate.
So, if the image is taller, the next article will only display after the
image. Best way to describe this would be if you were using tables,
each article would be contained within it's own row.

I have tried using clear:both, clear:left etc - but in all instances the
next set of data is being put at the bottom of the whole page (i.e
under the menus aswell, rather than just under the last article within
the 3rd column).

I hope I've explained this clearly enough - the code isn't currently
hosted so I can't point you to it to clarify, but any pointers or tips
for tags I should investigate further would be much appreciated.

LB
Jul 21 '05 #1
4 2404
Els
LB wrote:
I'm putting together a 3 column layout at the moment, the left 2 columns
are effectively menus and the third one is the 'content'.

Now, the content within the third column is brought in via a database,
and the problem I'm having is if an image file is 'taller' than the
text, the following article also wraps around the image. What I would
like to do is have that article, and its image, completely seperate.
So, if the image is taller, the next article will only display after the
image. Best way to describe this would be if you were using tables,
each article would be contained within it's own row.

I have tried using clear:both, clear:left etc - but in all instances the
next set of data is being put at the bottom of the whole page (i.e
under the menus aswell, rather than just under the last article within
the 3rd column).

I hope I've explained this clearly enough - the code isn't currently
hosted so I can't point you to it to clarify, but any pointers or tips
for tags I should investigate further would be much appreciated.


The thing is, that a clear:both or clear:left, will clear /any/
previous floats, including the ones in other 'columns'.
I haven't checked, but a clear:right may help in your case, if the
image would be floated right instead of left.

Otherwise you may consider making the 3rd column a float too, as
floats inside floats don't 'touch' floats outside their own (floated)
box.

Hmm.. that's a lot of floats in one sentence - I hope it still makes
sense?

If you're pursuing liquid design, obviously, you can't make the third
column a float, as floats need widths. However, you can float the two
left columns, set a margin-left on the third column (as I assume you
currently have it), and then inside the third column, you add another
<div> which will contain all the contents, and which you give a 100%
width and float:left.

You must be aware though, that in IE, the paddings and borders are
added to the width, so you can't give the floated inner div any
padding or border on top of the 100% width, as it won't fit in its
place that way. You'll need to either set the paddings on the
paragraphs, or insert yet another div inside the float, which you can
give paddings and borders to your liking :-)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: The Velvet Underground - I'm Waiting For The Man
Jul 21 '05 #2


LB wrote:
Apologies if this sounds like a very newbie question.

I'm putting together a 3 column layout at the moment, the left 2 columns
are effectively menus and the third one is the 'content'.

Now, the content within the third column is brought in via a database,
and the problem I'm having is if an image file is 'taller' than the
text, the following article also wraps around the image. What I would
like to do is have that article, and its image, completely seperate. So,
if the image is taller, the next article will only display after the
image. Best way to describe this would be if you were using tables,
each article would be contained within it's own row.

I have tried using clear:both, clear:left etc - but in all instances the
next set of data is being put at the bottom of the whole page (i.e
under the menus aswell, rather than just under the last article within
the 3rd column).

I hope I've explained this clearly enough - the code isn't currently
hosted so I can't point you to it to clarify, but any pointers or tips
for tags I should investigate further would be much appreciated.

LB


Try overflow:auto on the container

--

Jasper
http://browservulsel.blogspot.com/
Jul 21 '05 #3
LB
Els wrote:
The thing is, that a clear:both or clear:left, will clear /any/
previous floats, including the ones in other 'columns'.
I haven't checked, but a clear:right may help in your case, if the
image would be floated right instead of left.

Otherwise you may consider making the 3rd column a float too, as
floats inside floats don't 'touch' floats outside their own (floated)
box.

Hmm.. that's a lot of floats in one sentence - I hope it still makes
sense?

If you're pursuing liquid design, obviously, you can't make the third
column a float, as floats need widths. However, you can float the two
left columns, set a margin-left on the third column (as I assume you
currently have it), and then inside the third column, you add another
<div> which will contain all the contents, and which you give a 100%
width and float:left.

You must be aware though, that in IE, the paddings and borders are
added to the width, so you can't give the floated inner div any
padding or border on top of the 100% width, as it won't fit in its
place that way. You'll need to either set the paddings on the
paragraphs, or insert yet another div inside the float, which you can
give paddings and borders to your liking :-)


Thanks Els, I managed to follow that!

I tried a few variations, and in the end found the best route was to
create a container for the third column, then have each article within a
div set with overflow:auto - seems to have done the trick nicely.

Thanks again

LB
Jul 21 '05 #4
LB
Try overflow:auto on the container


Thanks Jasper, managed to sort it using that combined with some of Els
advice.

LB
Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1591
by: Bill Puetz | last post by:
I have a form with 4 different Submit buttons. In the action code, I do a request on the button names to see which one is valued. This all works great, until the browser is refreshed -- the request shows the name of the last button pressed. Is there a way to clear all the buttons so they don't appear to have been pressed when they've only been refreshed?
18
8089
by: Niels | last post by:
Hi group, I have some problems with clearing floated divs. My usual method works fine in Konqueror, but not in Firefox. Here's an example: <html><body> <div id='left' style='float:left; border:1px solid red;'>Floated left</div> <div id='right' style='float:right; border:1px solid blue;'>Floated right</div>
18
5706
by: JG | last post by:
Does anyone know a standard (or supported on Linux, Mac, Win32) way to clear a read stream buffer (standard ANSI C file stream)? I would even settle for a platform specific way of doing it. And no, I know I can use direct low level I/O or non-buffered to do reads, but for my app, I need the buffering. I can implement myself, but this is not optimal. Example, I open a read only file using fopen(). I periodically know
2
5220
by: Brett Romero | last post by:
After I remove all items from a combobox, the last selected item remains in the display area. I've tried: mycbox.SelectedText = string.Empty; and mycbox.refresh(); How do I clear the display area of a combobox after removing all of its
10
1880
by: FuzzyLogik | last post by:
<div id="bottomlinks"> <h3>Get Info On</h3> <ul> <li><a href="#">Search Engine Optimization</a></li> <li><a href="#">CSS</a></li> <li><a href="#">HTML / XHTML</a></li> <li><a href="#">AJAX</a></li> <li><a href="#">Web Design</a></li> <li><a href="#">Graphic Design</a></li> <li><a href="#">Print Design</a></li>
65
8646
by: Leslie Kis-Adam | last post by:
Hi everyone! Does anyone know, if it is possible to clear the screen in ANSI C? If it is,then how? Any help would be appreciated. Laszlo Kis-Adam <dfighter_AT-NOSPAM_freemail.hu
12
4293
by: Avalon1178 | last post by:
Hi, I have an application that periodically uses a std::string variable which is assigned a VERY VERY large string (15000000+ bytes long). This application is essentially a daemon, and it polls a data set which can have a lot of information and it is concatenated in this single string variable object. When the daemon finishes its job, it goes to sleep, but before doing so, it "clears" this variable so it can be reused again in the next...
2
5310
by: rsteph | last post by:
I've got a form set up that has a series of textboxes to enter employee info, with a listbox at the bottom listing all the employees with their title (to make it easier to find employees to edit information). I'm having a problem though - if I click around on the listbox to view some employee records, then want to add a new employee, when I click on the add record button it edits the last employee I looked at with the new information. I've...
9
2808
by: kardon33 | last post by:
Hi all, What i am trying to accomplish is take in a list of IP addresses from a text file (each Ip is on a new line). I got my program mostly working except when an IP address is longer than the last one it keeps the extra numbers beacuse im having trouble clearing the IP.
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10467
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.