By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,446 Members | 1,185 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,446 IT Pros & Developers. It's quick & easy.

Any thoughts on the differences between <span> & <div> layers?

P: n/a
Thanks in advance...
=~=
Timothy Casey
South Australia
wo****@iprimus.com.au

Formerly:
ca***@smart.net.au

Phenomenal Speed Comprehension:
Discover the World's most advanced speed reading application at:
http://www.fieldcraft.biz/shop/
Jul 20 '05 #1
Share this Question
Share on Google+
18 Replies


P: n/a
"Timothy Casey" <wo****@iprimus.com.au> wrote:
Thanks in advance...
For what?
Put your question in the body of your message.

<span> is an inline element.
<div> is a block element.
They have different content models and different default stylings.

<div> is used to mark up large divisions of a page (and as a generic
container for content that isn't better described by any other block
element, e.g. <p>, <h1>, <li>, <table>, <blockquote>, <address>,
etc.).

<span> is used to mark up short phrases that aren't better described
by any other inline element, e.g. <cite>, <em>, <strong>, <dfn>, etc.

They can both be styles in a variety of ways; but some properties will
not apply unless the display property is changed, as some properties
only apply to block level, and some only apply to inline level
elements.

Neither of them are "layers" unless they are positioned and have the
z-index property set.
=~=


What's this? A sig separator is '-- ' not '=~=' and that's why my
newsreader didn't trim your sig automatically.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2

P: n/a
Timothy Casey wrote:
Thanks in advance...


In HTML, span is inline by default; div is block. And they are not layers,
they are HTML tags.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 20 '05 #3

P: n/a
Els
Berislav Lopac wrote:
In HTML, span is inline by default; div is block. And they are not layers,
they are HTML tags.


And they are not HTML tags, they are HTML elements. ;-)

--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -

Jul 20 '05 #4

P: n/a
On Fri, 28 May 2004 22:22:04 +0930, "Timothy Casey"
<wo****@iprimus.com.au> wrote:
Thanks in advance...


What a question; or where is it ???

Here... http://www.google.com/search?q=SPAN+DIV

--
Rex

Jul 20 '05 #5

P: n/a
Els wrote:
Berislav Lopac wrote:
In HTML, span is inline by default; div is block. And they are not
layers, they are HTML tags.


And they are not HTML tags, they are HTML elements. ;-)


I sit corrected. :)

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 20 '05 #6

P: n/a
On Fri, 28 May 2004 16:31:22 +0200, Berislav Lopac
<be************@dimedia.hr> wrote:
Els wrote:
Berislav Lopac wrote:
In HTML, span is inline by default; div is block. And they are not
layers, they are HTML tags.


And they are not HTML tags, they are HTML elements. ;-)


I sit corrected. :)


Well, it's correct to call <span> and </div> "tags", whose purpose it is
to explicitly define the extent of the related element. But the content
between the tags, plus the tags themselves, that's the element.
Jul 20 '05 #7

P: n/a
"Steve Pugh" <st***@pugh.net> wrote in message
news:4d********************************@4ax.com...
"Timothy Casey" <wo****@iprimus.com.au> wrote:
Thanks in advance...
For what?
Put your question in the body of your message.


Sorry. On some of the busier newsgroups, the only way your question gets
read and answered is if it is in the subject line - with details & specs in
the message body.

Thanks for the information...

Is there any particular reason why browsers make the mistake of adding
lengths (heights/widths) to total greated than 100% when some of those
lengths are variable (IE described as percentages instead of pixels)? Why
not just pro-rata the remaining viewing length (after fixed lengths are
subtracted) amongst the variable (percentage) lengths?

I would not have thought there is any point in mixing variable and fixed
lengths if you did not intend to confine the total dimension to that of the
viewing area (subject to the total fixed length).

Any thoughts on this?
Is there a container that is treated, ahh, "correctly" with respect to
mixed length variability?

--
Timothy Casey [worloqATiprimus.com.au] Formerly: ca***@smart.net.au

Discover the world's most advanced speed-comprehension application at:
http://www.fieldcraft.biz/

<span> is an inline element.
<div> is a block element.
They have different content models and different default stylings.

<div> is used to mark up large divisions of a page (and as a generic
container for content that isn't better described by any other block
element, e.g. <p>, <h1>, <li>, <table>, <blockquote>, <address>,
etc.).

<span> is used to mark up short phrases that aren't better described
by any other inline element, e.g. <cite>, <em>, <strong>, <dfn>, etc.

They can both be styles in a variety of ways; but some properties will
not apply unless the display property is changed, as some properties
only apply to block level, and some only apply to inline level
elements.

Neither of them are "layers" unless they are positioned and have the
z-index property set.
=~=


What's this? A sig separator is '-- ' not '=~=' and that's why my
newsreader didn't trim your sig automatically.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>

Jul 20 '05 #8

P: n/a

"Timothy Casey" <wo****@iprimus.com.au> wrote in message
news:40********@news.iprimus.com.au...
"Steve Pugh" <st***@pugh.net> wrote in message
news:4d********************************@4ax.com...
"Timothy Casey" <wo****@iprimus.com.au> wrote:
Thanks in advance...
For what?
Put your question in the body of your message.


Sorry. On some of the busier newsgroups, the only way your question gets
read and answered is if it is in the subject line - with details & specs

in the message body.


Yes, something should always be in the subject line that reveals something
specific about your message. Posting a message to an HTML newsgroup with the
subject "Question" or "HTML question" is bound to put off many people who
have limited time and will only open message that they can tell from the
subject may be of interest to them.

However, you can't expect anyone to believe that anybody, no matter how busy
the newsgroup, is refusing to answer messages on the grounds that the body
doesn't exclude information already contained in the subject. And some
people *do* just open one message after the other without necessarily having
carefully read the subject before each one.

In other words (a) the subject should say something specific about what the
body is about, and (b) the body should be self-contained, with its
comprehensibility not dependent on the reader having read and memorized the
subject.

Jul 20 '05 #9

P: n/a

"Neal" <ne*****@yahoo.com> wrote in message
news:op**************@news.individual.net...
On Fri, 28 May 2004 16:31:22 +0200, Berislav Lopac
<be************@dimedia.hr> wrote:
Els wrote:
Berislav Lopac wrote:

In HTML, span is inline by default; div is block. And they are not
layers, they are HTML tags.

And they are not HTML tags, they are HTML elements. ;-)


I sit corrected. :)


Well, it's correct to call <span> and </div> "tags", whose purpose it is
to explicitly define the extent of the related element. But the content
between the tags, plus the tags themselves, that's the element.


Correct. Getting back to where that question arose, when someone write "span
is inline by default; div is block", it's the elements, not the tags that
delimit them, that are inline or block.

Jul 20 '05 #10

P: n/a

"Harlan Messinger" <h.*********@comcast.net> wrote in message
news:2h************@uni-berlin.de...

"Neal" <ne*****@yahoo.com> wrote in message
news:op**************@news.individual.net...
On Fri, 28 May 2004 16:31:22 +0200, Berislav Lopac
<be************@dimedia.hr> wrote:
Els wrote:
> Berislav Lopac wrote:
>
>> In HTML, span is inline by default; div is block. And they are not
>> layers, they are HTML tags.
>
> And they are not HTML tags, they are HTML elements. ;-)

I sit corrected. :)
Well, it's correct to call <span> and </div> "tags", whose purpose it is
to explicitly define the extent of the related element. But the content
between the tags, plus the tags themselves, that's the element.


Correct. Getting back to where that question arose, when someone write

"span is inline by default; div is block", it's the elements, not the tags that
delimit them, that are inline or block.


Which brings me to a pet peeve of mine: the kudzu-like spread of the
misnomer "alt tags" to refer to ALT attributes. I've been correcting people
I work with to say "alt attributes" or "alt text".

Jul 20 '05 #11

P: n/a
"Harlan Messinger" <h.*********@comcast.net> wrote:
Which brings me to a pet peeve of mine: the kudzu-like spread of the
misnomer "alt tags" to refer to ALT attributes. I've been correcting people
I work with to say "alt attributes" or "alt text".


Oh no, tag is perfectly correct, see the FAQ:
http://www.flightlab.com/~joe/sgml/faq-not.txt
First question in Part 5

;-)

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #12

P: n/a

"Steve Pugh" <st***@pugh.net> wrote in message
news:9j********************************@4ax.com...
"Harlan Messinger" <h.*********@comcast.net> wrote:
Which brings me to a pet peeve of mine: the kudzu-like spread of the
misnomer "alt tags" to refer to ALT attributes. I've been correcting peopleI work with to say "alt attributes" or "alt text".


Oh no, tag is perfectly correct, see the FAQ:
http://www.flightlab.com/~joe/sgml/faq-not.txt
First question in Part 5

;-)


LOL.

Jul 20 '05 #13

P: n/a
"Harlan Messinger" <h.*********@comcast.net> wrote in message
news:2h************@uni-berlin.de...

"Timothy Casey" <wo****@iprimus.com.au> wrote in message
news:40********@news.iprimus.com.au...
"Steve Pugh" <st***@pugh.net> wrote in message
news:4d********************************@4ax.com...
"Timothy Casey" <wo****@iprimus.com.au> wrote:

>Thanks in advance...

For what?
Put your question in the body of your message.
Sorry. On some of the busier newsgroups, the only way your question gets
read and answered is if it is in the subject line - with details & specs

in
the message body.


Yes, something should always be in the subject line that reveals something
specific about your message. Posting a message to an HTML newsgroup with

the subject "Question" or "HTML question" is bound to put off many people who
have limited time and will only open message that they can tell from the
subject may be of interest to them.
It is amazing the number of "HELP", "URGENT". not to mention, "Question"
subject lines that are not specific. When things get really busy, I've
noticed that the most descriptive and concise subject lines get the fastest
attention. Putting a good question in the subject line is more effective
than marking the message as urgent...

However, you can't expect anyone to believe that anybody, no matter how busy the newsgroup, is refusing to answer messages on the grounds that the body
doesn't exclude information already contained in the subject.
Not at all. Sometimes life gets busy, things get rushed, and post's get
missed. That is about all there is to it unless the newsgroup has a
religious nature to it. As for the missing body content - that is just sheer
laziness on my part!
And some
people *do* just open one message after the other without necessarily having carefully read the subject before each one.
I am accustomed to running my eyes down a list and picking the most likely
subject lines...

In other words (a) the subject should say something specific about what the body is about, and (b) the body should be self-contained, with its
comprehensibility not dependent on the reader having read and memorized the subject.


....and having avoided web-based newsreading has obviously left me short of
perspective. Thankyou for the heads-up!

--
Timothy Casey GPEMC! >> 11950 is the nu****@fieldcraft.biz 2email
Terms & conditions apply. See www.fieldcraft.biz/GPEMC
Discover the most advanced speed comprehension application at:
www.fieldcraft.biz/shop <BRef http://www.fieldcraft.biz/ki.htm >
Jul 20 '05 #14

P: n/a
On Fri, 28 May 2004 17:03:44 +0100, Steve Pugh <st***@pugh.net> wrote:
"Harlan Messinger" <h.*********@comcast.net> wrote:
Which brings me to a pet peeve of mine: the kudzu-like spread of the
misnomer "alt tags" to refer to ALT attributes. I've been correcting
people
I work with to say "alt attributes" or "alt text".


Oh no, tag is perfectly correct, see the FAQ:
http://www.flightlab.com/~joe/sgml/faq-not.txt
First question in Part 5

;-)

Steve


But "alt command" would be wrong, hmm? Funny bit.
Jul 20 '05 #15

P: n/a
"Timothy Casey" <wo****@iprimus.com.au> wrote in
comp.infosystems.www.authoring.stylesheets:
It is amazing the number of "HELP", "URGENT". not to mention, "Question"
subject lines that are not specific. When things get really busy, I've
noticed that the most descriptive and concise subject lines get the fastest
attention. Putting a good question in the subject line is more effective
than marking the message as urgent...


You can please some of the people some of the time ...
Seriously, I don't think the PP was saying you should not have a
good specific subject line. I think (I hope) he was just saying that
it's prudent to ask your question in the body because people do tend
to overlook subject lines.

I know I've done it myself -- misanswered a question because some
crucial bit of information was in the subject line and not in the
body. Sure, I was wrong -- but the person's question took longer to
get answered.

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #16

P: n/a
Timothy Casey wrote:
Is there any particular reason why browsers make the mistake of adding
lengths (heights/widths) to total greated than 100% when some of those
lengths are variable (IE described as percentages instead of pixels)?
Why not just pro-rata the remaining viewing length (after fixed
lengths are subtracted) amongst the variable (percentage) lengths?


I am not completely sure what exactly you have in mind here, but remember
that in CSS box model, the height or with you specify sets the dimensions of
the content; if you have any padding, it is added to the width/height. IOW,
if you set width 50% and padding 10px, those 10px will be in addition to
whatever turns out to be 50% at runtime.

Berislav

--
If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
Groucho, Chico, and Harpo, then Usenet is Zeppo.
Jul 20 '05 #17

P: n/a
On Sat, 29 May 2004 01:11:18 +0930, Timothy Casey <wo****@iprimus.com.au>
wrote:
Is there any particular reason why browsers make the mistake of adding
lengths (heights/widths) to total greated than 100% when some of those
lengths are variable (IE described as percentages instead of pixels)? Why
not just pro-rata the remaining viewing length (after fixed lengths are
subtracted) amongst the variable (percentage) lengths?
Width is, by definition, the dmension inside borders and padding. If you
set borders and padding in addition to width: 100%;, this will occur.
I would not have thought there is any point in mixing variable and fixed
lengths if you did not intend to confine the total dimension to that of
the
viewing area (subject to the total fixed length).

Any thoughts on this?
Is there a container that is treated, ahh, "correctly" with respect to
mixed length variability?


Mixed measurements are not correct.

By nesting <div>'s, one can mix measurements, but you must determine what
is mandatory.

More detail is needed to comment further.
Jul 20 '05 #18

P: n/a
Steve Pugh wrote:
"Harlan Messinger" <h.*********@comcast.net> wrote:
Which brings me to a pet peeve of mine: the kudzu-like spread of
the misnomer "alt tags" to refer to ALT attributes.


Oh no, tag is perfectly correct, see the FAQ:
http://www.flightlab.com/~joe/sgml/faq-not.txt

"That's element *type* name, dammit!" :-D

--
Brian (remove ".invalid" to email me)

Jul 20 '05 #19

This discussion thread is closed

Replies have been disabled for this discussion.