View Single Post
Old 01-09-2009, 05:52 PM   #20
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by Amalthia View Post
I don't suppose you can share the code? I don't really get what you mean? Though I understand what you mean about using the <div> tag instead. Though I'm not sure what the difference is between span and div.
Ok, hmm. So the most basic distinction in the CSS rendering model is between "block-level" and "inline-level" elements. Every open-close tag pair creates an "element" in the document tree. Every element in the tree creates a "box" in the display-model which contains the element's content. Boxes which are "block-level" create "blocks" in the display model -- paragraphs, etc which stack vertically on the page. Boxes which are "inline-level" are placed within blocks and flow one after another horizontally, but wrapping if necessary. So for example if you had an infinitely wide "page" with only inline-level elements, everything would render in one line.

The only difference between the <span/> and <div/> tags is that by default the <span/> tag creates an inline-level element while the <div/> tag creates a block-level element. This matters because certain properties -- like 'text-indent' -- apply only to block-level elements. If you want your specified 'text-indent' to be applied consistently, you have to make sure the element with that property is a block-level element. The two basic ways to do that are to use tags which create block-level elements by default (like <div/>) or specify a CSS property which causes the element to become block-level -- the most basic one being to set 'display' to 'block'.

Make sense?

Last edited by llasram; 01-09-2009 at 05:55 PM.
llasram is offline   Reply With Quote