Closed Thread Icon

Preserved Topic: Span or Div (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=20422" title="Pages that link to Preserved Topic: Span or Div (Page 1 of 1)" rel="nofollow" >Preserved Topic: Span or Div <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 08-28-2002 17:45

Just curious, but for some reason I've avoided using <SPAN> tags, and I'm not even sure why.
So whats the dealio... or rather... the difference between the two, and what do you prefer?
From what I've seen, the SPAN tag doesn't cause a line break and does not support the align property... does is support ID tag and class tag, making it a good candidate for CSS?

Thanks a bunch.
Karl

Karl www.AZProGolf.com
karl@azprogolf.com

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-28-2002 17:50

Span and Div are identical except that divs are block level and spans are inline. (which sort of means that divs cause line breaks before and after.)

Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 08-28-2002 18:04

so do you prefer SPANS or DIVS?

Similar subject: ID's vs. CLASS
I have a tendency to set the ID of a table (for example) rather than the class of a table, then in my CSS set the attributes of this table using the ID Selector "#". Is is this a good thing, bad thing, or indifferent?

Karl

Karl www.AZProGolf.com
karl@azprogolf.com

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 08-28-2002 18:29

IDs can only target a single object, where class can be used for many. So, if you had many tables that you wanted to style the same, you'd use a class. If you had just one, you'd use an ID.

SPANS and DIVS each have their place. It depends on the need.

Hugh
Paranoid (IV) Inmate

From: Dublin, Ireland
Insane since: Jul 2000

posted posted 08-29-2002 01:20

I use DIVs always , not sure why , one letter less I guess, also I really just use DIVs for moving stuff around, so the line break thing doesnt apply if its absolutly positioned. I thought divs where more supported, but that must be a rumour in my head. if you want divs side by side positioned relatively use spans, I think Ive needed that like once.

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 08-29-2002 15:38

As stated, it depends on what you are doing.

One is not better than the other, they are meant for different purposes.

Same with ID's and Classes.



« BackwardsOnwards »

Show Forum Drop Down Menu