hello. I tried this with a bit of search. I wish to have freedom while typing text in my web page. I want the right margin to be fixed so that when i type text all aligns along the right margin. I tried tables but not satisfied

<html>
<body>

<table border="0" width="40%" cellpadding="10">
<tr>

<td width="50%" valign="top">
This is some text. This is some text. This is some text. This is some text. This is some text.
</td>

<td width="50%" valign="top">
Another text. Another text. Another text. Another text. Another text. Another text. Another text.ndndnddndnnd
nddn
</td>

</tr>
</table>

</body>
</html>

i have studied html but this time it is to be used practically. I have liittle idea of CSS.

I tried in frontpage as well but there the problem was that text would get typed after a space of two lines when i press enter.I just want a way to comfortably manage my text. Thank you.

Dani AI

Generated

Short summary and practical fix for : the goal is to have a fixed right edge where typing wraps. Tables and absolute positioning (what tried) can force widths but they take elements out of normal flow and break when the window changes. Use a container with a defined width (or max-width) and let normal flow wrap. For multi-column layouts prefer CSS Flexbox or Grid so each column constrains its own right edge and stays responsive.

Example (modern, responsive approach):

<div class="layout">
  <div class="col">This is some text...</div>
  <div class="col">Another text...</div>
</div>
.layout { display: flex; gap: 16px; }
.col { flex: 1 1 50%; min-width: 0; box-sizing: border-box; padding: 8px; }

Use a fixed max-width on a parent if you want a single column with a fixed right margin (e.g., max-width:600px). min-width:0 on flex children prevents overflow so long lines wrap.

About the FrontPage/Dreamweaver double-line behavior: those editors insert paragraph tags on Enter; paragraphs have default margins, so you see extra space. For a single break use Shift+Enter (inserts <br>), or normalize paragraph spacing in your CSS (for example p{margin:0; line-height:1.4}). See MDN's Flexbox guide and the paragraph element notes for details: Flexbox guide and HTML paragraph element.

Recommended Answers

All 5 Replies

css might be the way to go...

<html>
<head>
<style type="text/css">
#text1{
margin: 0% 0% 0% 0%; position:absolute;
}
#text2{
margin: 0% 0% 0% 50%; position:absolute;
}
</style>
</head>

<body>
<div id="text1">
This is text 1
</div>

<div id="text2">
This is text 2
</div>
</body>

</html>

should do it...

however long line i type i should get it constrained by the right margin of the paragraph.This is not happening. Also some one tell me about the double lined problem in frontpage and dreamweaver.

however long line i type i should get it constrained by the right margin of the paragraph.This is not happening. Also some one tell me about the double lined problem in frontpage and dreamweaver.

then you have to add a width in the css, so it looks like this:

<html>
<head>
<style type="text/css">
#text1{
margin: 0% 0% 0% 0%; position:absolute;
width: 45%
}
#text2{
margin: 0% 0% 0% 50%; position:absolute;
width: 45%
}
</style>
</head>

<body>
<div id="text1">
This is text 1, This is text 1, This is text 1, This is text 1, This is text 1, This is text 1, This is text 1, This is text 1, This is text 1, This is text 1
</div>

<div id="text2">
This is text 2, This is text 2, This is text 2, This is text 2, This is text 2, This is text 2, This is text 2, This is text 2, This is text 2, This is text 2
</div>
</body>

</html>

And, l am not sure what you meen with the the double line thing, l use Notepad ++ for everything l do... Let me know how this goes fo ya..

it's so hard ...

I want to have a site ???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.