473,597 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text overflows column 1 of a two column CSS layout

9 New Member
I created a two column CSS layout by
floating the columns left and right respectively.

When I put text into the first column (via HTML) it continues in
a straight line through the second column and beyond
instead of going onto a new line within the first
column when it reaches the right hand edge of the
first column.

The code is below. Main is the name of the left hand
column and ads is the name of the right hand column.

If you've got the time, have you any idea what is
wrong.

Regards

Jim Walsh



[code] (CSS )

body{
margin:0;
padding:0;
background-color:#0000cc;
min-width:750px
}

div.wrap{
background-color:#cc0000;
margin:0 auto;
padding:0;
width:750px
}

div.header{
background-color:#ddd;
margin:0;
padding:5px;
text-align:center
}

div.links1{
background-color:#c99;
padding:5px
}

div.links2{
background-color:#cc9;
padding:5px
}

div.main{
float:left;
width:500px;
background-color:#cc0000;
padding:0 10px
}

div.ads{
background-color:#c9c;
float:right;
width:150px;
padding:0 10px
}

div.links1 ul{
margin:0;
padding:0;
list-style:none
}

div.links2 ul{
text-align:center;
word-spacing:15px;
margin-bottom:0;
margin:0;
padding:0;
list-style:none
}

div.links1 li
{background-color:orange;
margin:20px;
display:inline;
margin-left:20px;
margin-right:20px
}

div.links2 li{
display:inline;
margin:0;
padding:0
}

h5{
text-align:center;
padding:0 10px
}

a{

text-decoration:none ;
border-style:ridge;
border-color:blue;
padding-left:10px;
padding-right:10px
}

a:link{
color:black;
background-color:orange;
}

a:active{
color:white;
background-color:teal
}

a:visited{
color:purple;
background-color:#aa11aa}

[code](END OF CSS)

[code] HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>Visit Bangkok Accomodation</title>
<link rel="stylesheet " type="text/css" href="bkkcss.cs s"></link>

</head>
<body>

<div class="wrap">

<div class="header">
<h1>Visit Bangkok</h1>
</div>


<div class="links1">
<ul>
<li><a href="bkkaccomo dation.html">ac comodation</a></li>
<li><a href="bkkplaces togo.html">plac es to go</a></li>
<li><a href="bkkwhatso n.html">what's on</a></li>
<li><a href="bkktravel .html">travel</a></li>
<li><a href="bkkmapsan dguides.html">m aps and guides</a></li>
<li><a href="bkkpeople likeyou.html">p eople like you</a></li>
</ul>
</div>


<div class="links2">
<ul>
<li><a href="bkkhotels .html">hotels</a></li>
<li><a href="bkkapartm ents.html">apar tments</a></li>
<li><a href="bkkselfca tering.html">se lfcatering</a></li>
<li><a href="bkkhomest ay.html">homest ay</a></li>
<li><a href="bkkcampin g.html">camping </a></li>
<li><a href="bkkcarava ns.html">carava ns</a></li>
</ul>
</div>

<div class="main">
testqertyuiop[]asdfghjkl;'zxcv bnm,./qwertyuiop[sdfghjkl;zxcvbn m,,.qwertyuiop[asdfghjkl;zxcvb nm,qwertyuiop[asdfghjkl;zxcvb nm,qwertyuuii
</div>


<div class="ads">

<h5>Sponsored Advertisements</h5>

</div>


</div>
</body>
</html>

[code] END OF HTML
Aug 19 '07 #1
1 1983
phvfl
173 Recognized Expert New Member
Hi Jim,

The text is overflowing because there is not break in the string for there to be a line break. If the length of a single word or string is greater than the width of the container then the string will overflow. The behavior of this can be controlled using the CSS overflow property. There are four values for this: auto, visible, hidden and scroll.

Auto - automatically determines the overflow property, usually visible although for a textarea would be scroll.

Visible - the overflowed content is visible (as in your case)

Hidden - the overflowed content is hidden and there is no sign that there is overflowed content.

Scroll - a scroll bar is added so that the information can be seen. While this is useful as it ensures no information is lost or overlaps another element accidentally it can lead to an untidy looking page.

If you do not want the overflow ensure that either no single word is longer than the width of the column or specify the overflow behavior to either hidden or scroll.
Aug 19 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
3303
by: Zak McGregor | last post by:
Hi all I have a simple 3 column css layout here: http://www.carfolio.com/newlook.dhtml However, when the centre column is wider than the screen (yes, it does happen on some pages on the site and no it can't happen differently) then the 3rd column overlays itself over the middle column's content. Is there a css-based 3 column layout without ugly hacks that will give me a 3rd column as far to the right as need be? Can anyone suggest a...
13
2069
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does overflow. All I know is that the program is either stopped due to an exception at the end of Main or has exited after the Stack Overflow exception. (Both cases are Debug builds running in the debugger.) After a lot of trial and error (mostly...
14
3078
by: Eric Lindsay | last post by:
I've seen a page using display, and especially display table that did some neat things with boxes, but basically it only worked with Mozilla browsers. Fell over fairly badly with Opera and Safari (I don't have IE, but I have my suspicions that wouldn't work either). I'd like to use CSS to put some boxes down the middle of a page. The page is intended to be fluid, but the boxes all need to be the same width, which can be variable...
3
3985
by: hikums | last post by:
I have taken a table snapshot, and noticed two tables with high overflows. What should be done, if any. Table Schema = CASTING Table Name = ABC Table Type = User Data Object Pages = 309 Index Object Pages = 56 Rows Read = Not Collected Rows Written = 1368
18
7882
by: ~john | last post by:
Sorry if this is a dumb question buy my CSS is pretty bad... but how do I get text to center vertically within a div tag? Here's my code below... the text is displaying on the far top-right. I would like it far right centered vertically. #test { width: 100%; height: 55px; margin: 0 0 0 0;
1
1013
by: jimchapuk | last post by:
I created a two column CSS layout by floating the columns left and right respectively. When I put text into the first column (via HTML) it continues in a straight line through the second column and beyond instead of going onto a new line within the first column when it reaches the right hand edge of the first column. The code is below. Main is the name of the left hand
2
3225
by: TyIzaeL | last post by:
This problem I'm having has me stumped. What is happening is I have a three column layout for a clan web portal and text in the left/right columns spills out of the side if the line is long enough. I can't figure out why it isn't wrapping inside the box. The problem happens in Firefox 2, 3, IE 7, and Opera 9.27, so I know it isn't a simple browser quirk. Here is a picture to help visualize. http://i27.tinypic.com/169g5z4.png HTML:...
1
4187
by: littlealex | last post by:
IE6 not displaying text correctly - IE 7 & Firefox 3 are fine! Need some help with this as fairly new to CSS! In IE6 the text for the following page doesn't display properly - rather than being aligned to the top, along with the slideshow and link buttons, you have to scroll down to see the text - how can I make IE6 display correctly? http://geekarama.co.uk/new_home.html here is the code for new_home.html and following that the CSS...
4
3980
by: Jeff | last post by:
Hey I'm wondering how the Fixed-Width Text Format is What I know is that the top line in this text format will contain column names. and each row beneath the top line represent for example a row in a table etc... But does fixed-with mean that every column has a fixed with: for example first column is 10 char wide and second column is 30 char wide?
0
7979
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
7894
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
8281
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
8046
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
8262
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
6706
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
5437
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();...
0
3893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1497
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.