232 Active Lovers [Record: 1991 on 12 November, 2007]
Lost PasswordRegister
Lover's Lounge
Color Forums / Color Talk / Lover's Lounge
The life and times of fellow color lovers. Dish your dirt. Share a secret. (we won't tell anyone you told us)
Front-End Web-Design Noob Needs A Virtual Hand


codename_…
2 Months Ago
I'm probably about to wear my ignorance on my sleeve here, but that's why I'm asking the nicest group of people I know. ;-)

So I'm getting pretty well encroached in front-end web-design lately, having fun painting blocky pictures of colorful content-spewing cubes of wonderment and the like.

But I've encountered two interesting quandaries that, fundamental as they are, continue to bug the hell out of me.

Span elements and IDs- when the hell are these ultimately more useful than div or class, and not just because they're only needed once?

I'd seriously like to know...

... Please? :-P

subsomati…
subsomatic wrote:
2 Months Ago
Heya,

A span is basically the same thing as a div, but it's not a block element (no padding, margin, width, height, etc) , so it applies better to things like font colour, font weight.

The difference between IDs and classes - classes you use as many times as you want, IDs you only use once. So if you have only ever one instance of the element on the page (like a top banner or something) you should be using and ID.

Some more info for you,
http://www.tizag.com/cssT/cssid.php
http://www.learnwebdesignonline.com/htmlcourse/span-div.htm

Hope that helps!

onebreath
onebreath wrote:
2 Months Ago
To clarify what subsomatic said, div means styling a whole block whereas 'span' means styling an element within a line.

See the difference between:

With div I'm styling the whole block of text.

With span I can style only this part of my text.

Incidentally, as div means block it also means line-break.

If I'm applying a div
in the middle of
a sentence I'm automatically starting a new block.

onebreath
onebreath wrote:
2 Months Ago
(Can't edit my previous comment. Bad onebreath!)

To clarify what subsomatic said, div means styling a whole block whereas 'span' means styling an element within a line.

See the difference between:

With div I'm styling the whole block of text.


With span I can style only this part of my text.

Incidentally, as div means block it also means line-break.

If I'm applying a div
in the middle of
a sentence I'm automatically starting a new block.

J-man
J-man wrote:
2 Months Ago
Generally you want to use ids for more the main parts of the page, like the header, content, footer.. (I can't wait til HTML 5.. We get tags like [header] and [footer]!)

Classes are more for smaller stuff.. At least in my opinion. I like ids, and tend to overuse them sometimes.. ;)

Edit: lol, you div tags are messing up the page.. ;)

onebreath
onebreath wrote:
2 Months Ago
I know J-man. I typed </span> instead of </div> so my div stayed unclosed and I can't edit my comment. *cries*

I also like to use IDs for the main stuff (header, footer, content holders/wrappers).

J-man
J-man wrote:
2 Months Ago
Really? I can edit mine.. Strange. I wonder if I can fix it by adding a div tag.. 0_o *tries it*



Yay, I fixed it. For some reason it wouldn't let my edit until I refreshed the page.

codename_…
2 Months Ago
Hahaha...

Thanks everybody, I appreciate all the help...

though this page is still a little warped. :-P

    Please Log In to Add a Comment

More Colors, Palettes & Patterns
Latest Palettes & Patterns
Recently Active Lovers
ForumsPalettesColorsPatternsLoversBlogTrendsGroupsStoreAboutContactAPIFAQ
© 2008 Lord IV. All Rights Reserved | Privacy & Terms of Use