473,385 Members | 1,843 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,385 software developers and data experts.

Side bar do not wrap the text when too long

Hello:

I just want to use a two columns web. If I put sidebar on the
right, it there is a list, it's fine. If it is a paragraph, the width
will not work?

Why?

In the following example, width is 200 px, but the contents is much
long than that.

Thanks.

Z. D.


#wrapper {
width: 760px;
margin-right: auto;
margin-left: auto;
text-align: left;
}
#main {
margin-right: 200px;
background: red;
}
#sidebar{
float: right;
width: 200 px;

background: darkgreen;

}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="Style/style2.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">

<div id="sidebar">

too long to wrap too long to wrap too long to wrap too long to
wrap too long to wrap too long to wrap too long to wrap
</div>

<div id="main">

main contents main content main contentss main contents main
contents main content main contentss main contents main contents
main content main contentss main contents
main contents main content main contentss main contents main
contents main content main contentss main contents main contents
main content main contentss main contents
</div>


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

May 22 '07 #1
1 5730
On 2007-05-22, du*******@gmail.com <du*******@gmail.comwrote:
Hello:

I just want to use a two columns web. If I put sidebar on the
right, it there is a list, it's fine. If it is a paragraph, the width
will not work?

Why?

In the following example, width is 200 px, but the contents is much
long than that.
You need to write "200px", without a space, not "200 px" which is what
you have, and which is causing a parse error.
Thanks.

Z. D.


#wrapper {
width: 760px;
margin-right: auto;
margin-left: auto;
text-align: left;
}
#main {
margin-right: 200px;
background: red;
}
#sidebar{
float: right;
width: 200 px;

background: darkgreen;

}


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="Style/style2.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">

<div id="sidebar">

too long to wrap too long to wrap too long to wrap too long to
wrap too long to wrap too long to wrap too long to wrap
</div>

<div id="main">

main contents main content main contentss main contents main
contents main content main contentss main contents main contents
main content main contentss main contents
main contents main content main contentss main contents main
contents main content main contentss main contents main contents
main content main contentss main contents
</div>


</div>
</body>
</html>
May 22 '07 #2

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

Similar topics

2
by: needhelp | last post by:
This one ought to be simple, but I have dug myself deeper and deeper, and gone farther and farther from what I wanted and I'm giving up. And my html that I've written is so bolloxed up now that...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
5
by: name | last post by:
Back for more critique. ---------------------------------------------------------------- #include <stdio.h> #include <stdlib.h> #include <string.h> #include <limits.h> #define MAX 10000
0
by: amessimon | last post by:
Hi I have a long form - around 80 fields - which i have decided to break up into more manageable sections using the <asp:Panel> control. Basically i have three panels (stages) containing...
3
by: Larry David | last post by:
Hi, I'm just trying to wrap my mind around the ASP.NET model. Let me walk you through a trivial scenario: Let's say I have a form containing a text box where the user enters his name. It also...
9
by: shapper | last post by:
Hello, What is the best way to place an image and a text side by side using CSS? Basicaly what I am trying to do is to make the image and the text to appear as follows: Image My Text......
6
by: Victor | last post by:
Hi all i have a css question about how to wrap a long text by using css. for example I have a very long text like "ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" there...
15
by: removeps-groups | last post by:
How to wrap text in <ptag if the text has no spaces and is very long? Here is an example: ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.