Jump to content

span or div?


ki

Recommended Posts

Keep in mind that, with CSS, anything is possible ;)

You can make a span behave exactly like a div when you apply a display: block to it. Also, I could make my site show all divs as spans by giving them a display: inline if i chose to. The issue here, though is that each element has a specified purpose, and there's not much sense in trying to break those elements out of their intended purpose when there are other elements to do what you're after. Also, keep in mind that with CSS, you can get things to [b]look[/b] right, but having a div inside a span will never validate properly since, as far as HTML is concerned, it is still a block level element inside an inline tag.
Link to comment
Share on other sites

ToonMariner is right. This layout uses div containers (id and class) for layout and spans (class) only for visual design.

Did you confuse <div class="something"> with <span class="something"> as both being "spans"?

P.S. It will most likely blow-up in IE7 because his conditional comment is only for IE6.
Link to comment
Share on other sites

Well what I was trying to get around is that div is allowed in one line unless used by the float: command, now im not all that good in knowledge of css but I know my way around it. I notice a span seems more flexible. But my problem is im not understanding how to display some of the stuff he used such as images and stuff to his advantage in the span cases.Or could someone give me a view on how to display more than one div on a line with out the float command?
Link to comment
Share on other sites

[quote]Or could someone give me a view on how to display more than one div on a line with out the float command?[/quote]

Well, this layout is indeed using floats (he just styles them within the actual html markup - and not in the css).

This is actually an extremely clever layout (although he is a wise guy for pulling that "IE error" pop-up crap - not there in FF, so I got suckered since I don't use IE much).

Overall, it Looks like he is just using two main elements - the leftsideextra is a "fixed position element, while the rest is held in a single margin positioned container.

He then floats any side-by-side content (like the Donation top list) by styling the float in the markup).

The best way to see what he did is to use Firefox and use the information viewing tools from the (MUST HAVE) installed web developer's toolbar extension.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.