2 replies [Last post]
Iceman
Offline
newbie
Last seen: 17 years 9 weeks ago
Joined: 2003-11-22
Posts: 2
Points: 0

Hi everybody. I'm a newbie in CSS formatting, but I'm starting to understand the power and flexibility of this, and I'd appreciate any help with a problem I'm having.

I'm building a small site for an even smaller magazine that want to put its contents on the web. They publish text in columns that doesn't have space between paragraphs, but they use an indent space at the first line of each paragraph.

In order to eliminate spaces between paragraphs I'm using <BR> instead <P> to separate the text lines, and then add an indent space to the <BR> tag to "push" the first line of each paragraph 10px inside the text block.

But when I try to redefine the BR tag with CSS I just can't get it working, it doesn't show the indent space. I've tried it in both Mozilla and IE. Here is an example of my code:

<style type="text/css">
<!--
br {
	text-indent: 10px;
}
-->
</style>

<table width="300" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>Text text text  text text text text text text text text text text text text text text text text text text text text text text.<br>
    Text text text text text text text text text text text text text text text text text text text.</td>
  </tr>
</table>

Somebody can give me an advice? There is another way to achieve the same result, perhaps using another technique? Any help is greatly appreciated, thanks in advance.

Daybreak_0
Offline
Enthusiast
Sydney, Australia
Last seen: 17 years 10 weeks ago
Sydney, Australia
Timezone: GMT+10
Joined: 2003-11-15
Posts: 389
Points: 0

How to add an indent space to my BR tags?

Don't use <br> it is not designed for what you want.

Use <p> but define what you want in the CSS. Just in case you use <p> somewhere else use a class as well.

<style type="text/css"> 
 
p.indented /* instead of just p {*/
{ 
margin: 0px;
padding: 0px;   
text-indent: 10px; 
} 

</style> 

<table width="300" border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
    <td><p class="indented">Text text text  text text text text text text text text text text text text text text text text text text text text text text.</p> 
<p class="indented">Text text text text text text text text text text text text text text text text text text text.</p></td> 
  </tr> 
</table> 

grrr pull you finger out Australia, we are going to lose the rugby world cup - got to go

Day

The only way to learn is to do it yourself

Iceman
Offline
newbie
Last seen: 17 years 9 weeks ago
Joined: 2003-11-22
Posts: 2
Points: 0

How to add an indent space to my BR tags?

Thank you very very much, that's exactly what I needed Laughing out loud