By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,402 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Side bar do not wrap the text when too long

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.