473,396 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can you create a DIV that won't break from its content?

Is it possible to create a DIV that could be, for example, 300 x 200
pixels and make it so whatever content might appear in it, won't break it?

Let me try to explain:

Let's say I have a site with dynamic content, and I've created a DIV with
the above dimensions. Let's say the content was too big for the DIV. I
don't want the DIV to break and expand past its designated pixels. I'd
prefer for the content to be truncated somehow.

Is this possible?
--
[================================================== ===========================]
Sugapablo -> http://www.sugapablo.net
[================================================== ===========================]

Nov 23 '05 #1
3 2391
Els
Sugapablo wrote:
Is it possible to create a DIV that could be, for example, 300 x 200
pixels and make it so whatever content might appear in it, won't break it?

Let me try to explain:

Let's say I have a site with dynamic content, and I've created a DIV with
the above dimensions. Let's say the content was too big for the DIV. I
don't want the DIV to break and expand past its designated pixels. I'd
prefer for the content to be truncated somehow.

Is this possible?


Yes, just set overflow:hidden; or overflow:auto; for that div.
'hidden' will truncate it, 'auto' will make the contents scroll if
they need more space than the div is providing.

I've ignored your follow-up btw, as you didn't state it in the message
(not all newsreaders give a warning when a follow-up is set). This
means others would reply, without seeing the replies that are already
given.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Nov 23 '05 #2
Els wrote:
Sugapablo wrote:

Is it possible to create a DIV that could be, for example, 300 x 200
pixels and make it so whatever content might appear in it, won't break it? Is this possible?

Yes, just set overflow:hidden; or overflow:auto; for that div.
'hidden' will truncate it, 'auto' will make the contents scroll if
they need more space than the div is providing.


This does work perfectly well mechanically. Whenever I start thinking
about doing it, though, an internal alarm goes off. It tells me that
I'm trying to cram too much information onto a single page and that I'm
thinking too much like a print designer. There might still be a
special case where it is warranted, but I can't think of one off the top
of my head.
Nov 23 '05 #3
Sugapablo wrote:
Let's say I have a site with dynamic content, and I've created a DIV with
the above dimensions. Let's say the content was too big for the DIV. I
don't want the DIV to break and expand past its designated pixels.
Note that by setting the 'height' and 'width', the box should always be
that size and in standards compliant browsers, it will be. IE, however,
incorrectly treats 'height' and 'width' a little bit like 'min-height'
and 'min-width' (not exactly the same, though) and therefore breaks the
rules by increasing the size of the box to fit the content, which sounds
somewhat like the described behaviour that you don't want.
I'd prefer for the content to be truncated somehow.


overflow:hidden;

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Nov 23 '05 #4

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

Similar topics

9
by: Phil Powell | last post by:
I am using PHP 4.3.2 to create a CSV file, however, Excel constantly views it as a single-column spreadsheet with everything in quotes, whereas OpenOffice Calc views it as a legitimate spreadsheet...
1
by: 195.229.241.2 | last post by:
Dear group, I'm using <DIV> tags to display some content with absolute positioning. The content sometimes goes more than 1 page. So i would like to have page break after 1 set of content is...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
4
by: Miguel Dias Moura | last post by:
Hello, I created a datalist in an ASP.Net / VB page. I display the image and price of a few products. When a user clicks an image I want to load the page "detail.aspx?number=id" and send the...
1
by: dotNetDave | last post by:
I keep getting the following error on one of my web service pages: Parser Error Parser Error Message: Could not create type 'SyPixx.Web.ClearService.ConfigureAlarms'. Source Error: Line 1: ...
2
by: Sugapablo | last post by:
Is it possible to create a DIV that could be, for example, 300 x 200 pixels and make it so whatever content might appear in it, won't break it? Let me try to explain: Let's say I have a site...
18
by: Steven Bethard | last post by:
I've updated the PEP based on a number of comments on comp.lang.python. The most updated versions are still at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt...
2
by: Angel Of Death | last post by:
I have a method. It takes some XML as a parameter. Depending on the content of the XML it should create a specific object and call a KNOWN method. So: public void PersistXml(string XmlData){} ...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
2
by: urbanedge | last post by:
I've just acquired a site and uploaded to godaddy and the email function won't work. I'm new to php and I'm not able to determine where the issue is. I've commented out $this->header .=...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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...
0
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...

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.