Forum Moderators: not2easy

Message Too Old, No Replies

span indents first line, div indents whole paragraph

         

Hugene

10:18 pm on Sep 23, 2006 (gmt 0)

10+ Year Member



In IE 6.0, when I put <span class="paragraph"> </span> around a text, the first line is indented. When I put <div class="paragraph"></div> around a text, the entire paragraph is indented.

In Firefox, these two cases do not occur.

I want to get rid of this indentation in IE. Someone has an idea?

penders

11:05 pm on Sep 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is your CSS for class 'paragraph'?

DrDoc

11:47 pm on Sep 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And, if it is truly a paragraph, shouldn't you be using
<p>
? :)

Hugene

4:29 am on Sep 24, 2006 (gmt 0)

10+ Year Member



Ok, I solved it. I think it was the following: I had

padding-left=0px;
padding-right=30px;
padding-top=5px;
padding-bottom=3px;

and I believe Firefox was taking the instruction padding-left=0px; correctly whereas IE was not.

Ingolemo

1:20 pm on Sep 24, 2006 (gmt 0)

10+ Year Member



Your css is invalid, you should use a colon to seperate properties from their values like so:
padding-left:0px;
padding-right:30px;
padding-top:5px;
padding-bottom:3px;

Unfortunatly, this doesn't seem to explain the problem you've been having. Take DrDoc's advice and use a <p> for paragraphs.

penders

11:08 am on Sep 25, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



(Hypothetical, since should ideally use a <p> tag (as stated above).)

But, if you had say

padding-left:40px
on your <span> tag, then this will only indent your first line (both FF and IE6) since it is an inline element, and the line box is simply spanning several lines.

If you applied this style to a <div> then it will pad the entire left side, since it is a block level element.