HighDots Forums  

two, possibly off-topic, questions

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss two, possibly off-topic, questions in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Maury Merkin
 
Posts: n/a

Default two, possibly off-topic, questions - 06-06-2004 , 11:35 AM






Question 1:

Everyone here seems settled that the <div> tag is the place for an id
attribute and <span> tags are for class attributes. Why? It seems to me
that they are interchangeable. (Something about the aesthetics of the
whole thing wants to do away with <div> tags altogether and simply use
<span>. Is there some trap in doing this that I haven't found yet?)


Question 2:

I like the idea of inline frames. Hell, I may as well admit it, I like
frames [I hate when a menu scrolls off the screen because the doc I'm
viewing has to be scrolled through] but I do understand that they create
problems and I'm not going to argue this now. My question is that I have
one particular project where an <iframe> is REALLY helpful. Alas, only
Opera and Konqueror treat my code with respect. Both Mozilla and IE
refuse to replace my docs inside the frame and, instead, open a new
window. Is that simply the current state of support for <iframe> or are
there things that can get these others to play nice?

(The specific files I want to use contain copyrighted material which I'm
reluctant to put on the WWW, but if my description of this problem is
inadequate, I'll put some dummy files up to show you what I mean.)

Maury

--
http://www.his.com/~merkin

Reply With Quote
  #2  
Old   
Steve Pugh
 
Posts: n/a

Default Re: two, possibly off-topic, questions - 06-06-2004 , 11:50 AM






"Maury Merkin" <merkin (AT) his (DOT) com> wrote:

Quote:
Everyone here seems settled that the <div> tag is the place for an id
attribute and <span> tags are for class attributes.
Have they? I see no evidence of that.

Quote:
Why?
Maybe you're getting that impression beacause large divisions of a
page (marked up with <div>s) are more likely to be unique and hence
labelled with an id. Whilst short phrases (marked up with <span>s) are
more likely to occur more than once and thus should be labelled with
class.
<div id="navigation"> vs <span class="date">

But id and class can be applied to any element.

Quote:
It seems to me hat they are interchangeable.
In HTML terms they are not. <div> is a block, <span> is inline; they
have different content models, etc.

Whilst they can be made to appear the same via CSS (i.e. display:
inline; for div or display: block; for span) that doesn't change they
structural nature.

Quote:
(Something about the aesthetics of the
whole thing wants to do away with <div> tags altogether and simply use
span>. Is there some trap in doing this that I haven't found yet?)
You can't nest paragraphs, tables, lists, headings, blockquotes, etc.
inside spans.

Quote:
one particular project where an <iframe> is REALLY helpful. Alas, only
Opera and Konqueror treat my code with respect. Both Mozilla and IE
refuse to replace my docs inside the frame and, instead, open a new
window. Is that simply the current state of support for <iframe> or are
there things that can get these others to play nice?
How are you linking to the new document?
Is the link inside the iframe or in the parent page?

Quote:
(The specific files I want to use contain copyrighted material which I'm
reluctant to put on the WWW, but if my description of this problem is
inadequate, I'll put some dummy files up to show you what I mean.)
Yes do so.

Steve

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

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #3  
Old   
Steve Pugh
 
Posts: n/a

Default Re: two, possibly off-topic, questions - 06-06-2004 , 12:02 PM



Steve Pugh <steve (AT) pugh (DOT) net> wrote:
Quote:
"Maury Merkin" <merkin (AT) his (DOT) com> wrote:
re: <iframe> question

Quote:
(The specific files I want to use contain copyrighted material which I'm
reluctant to put on the WWW, but if my description of this problem is
inadequate, I'll put some dummy files up to show you what I mean.)

Yes do so.
But do so in another newsgroup, it's not a stylesheet issue. I'd
suggest comp.infosystems.www.authoring.html

Steve

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

Steve Pugh <steve (AT) pugh (DOT) net> <http://steve.pugh.net/>


Reply With Quote
  #4  
Old   
Neal
 
Posts: n/a

Default Re: two, possibly off-topic, questions - 06-06-2004 , 04:27 PM



On Sun, 06 Jun 2004 11:35:39 -0400, Maury Merkin <merkin (AT) his (DOT) com> wrote:

Quote:
Question 1:

Everyone here seems settled that the <div> tag is the place for an id
attribute and <span> tags are for class attributes.
Where is "here"? On this newsgroup, it's understood that id and class are
used more appropriately than that. If you mean a different "here", I
assure you "they" are wrong.


Reply With Quote
  #5  
Old   
Stan Brown
 
Posts: n/a

Default Re: two, possibly off-topic, questions - 06-06-2004 , 06:17 PM



"Maury Merkin" <merkin (AT) his (DOT) com> wrote in
comp.infosystems.www.authoring.stylesheets:
Quote:
Everyone here seems settled that the <div> tag is the place for an id
attribute and <span> tags are for class attributes.
Huh? I don't know where "here" is, but I've never observed any such
consensus.

id attributes must be unique within page; a class can be used many
times on a page. That's kind of irrelevant to using div or span
tags.

--
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/


Reply With Quote
  #6  
Old   
Harlan Messinger
 
Posts: n/a

Default Re: two, possibly off-topic, questions - 06-06-2004 , 08:12 PM



"Maury Merkin" <merkin (AT) his (DOT) com> wrote:

Quote:
Question 1:

Everyone here seems settled that the <div> tag is the place for an id
attribute and <span> tags are for class attributes.
The id attribute is a unique identifier, used to name a single element
on a page. (This isn't merely a custom or common practice, it's a rule
of HTML. Using the same id value twice on one page results in an
invalid page.) Applying a style to the element that has a particular
id is only one of the uses of the id attribute. Other uses include
setting destinations for internal document links and DOM manipulation
by script.

The class attribute is to indicate that any number of elements are
intended to share some set of characteristics, typically a set of
styles. For example, you might have classes for names of species
(recalling a discussion held here several months ago), links to
entries in your web site's glossary (as distinct from links to any
other page), footnotes, lines of poetry, and so on.

If you use DIVs to divide your page up into its principal components,
then, yes, each DIV will probably have a distinctive function that
would be best reflected in a unique ID: "banner", "leftnav", "topnav",
"footer", "sidebar", "maincontent". These are things of which the page
has one each. So it makes sense that *these* DIVs would have id
attributes, which would be used to apply styles specific to one or
another of them. But if, say, you have a lot of photographs on your
page, each with information related to it in a particular format, then
you might want to wrap a DIV around each photo with its info, and
format all these DIVs the same way. That would call for a class rather
than an ID.

There isn't generally any reason why a non-block element on a page
would warrant having a style assigned to it based on a unique ID, even
if it has one. So for spans, styles will most likely be associated
with them based on classes (like "species", "glossarylink", "poetry",
"footnote", and so forth)..

Quote:
Why? It seems to me
that they are interchangeable. (Something about the aesthetics of the
whole thing wants to do away with <div> tags altogether and simply use
span>. Is there some trap in doing this that I haven't found yet?)

DIVs are blocks and SPANs are inline. Yes, you can change that with
CSS, but speaking in terms of document structure, a DIV is, a full
division of the page, if you think of a page being broken up into
blocks. A span is not necessarily an integral component of anything.


--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.


Reply With Quote
  #7  
Old   
Lachlan Hunt
 
Posts: n/a

Default Re: two, possibly off-topic, questions - 06-06-2004 , 08:27 PM



Maury Merkin wrote:
Quote:
Question 1:

snip>Question about using <div> and <span> with ids and classes.</snip


Question 2:

snip>Question about <iframe></snip
Then why on earth did you post them to c.i.w.a.stylesheets? They're
clearly HTML questions, which should be directed at c.i.w.a.html, where
they would actually be two, possibly /on-topic/, questions.

Quote:
(The specific files I want to use contain copyrighted material which
I'm reluctant to put on the WWW, but if my description of this problem
is inadequate, I'll put some dummy files up to show you what I mean.)
When you're experiencing a problem with some code, it is always
preferable to upload some files to a server somewhere and give a URI.
Or, at a minimum, provide a small snippet of sample code, so that
someone may see where you're error is; however this is *not* useful for
full HTML files, where we would need to copy the code and make a new
file to test it — it's too time consuming. Also, validating you're code
first always helps, and may infact solve you're problem without needing
to ask.

--
Lachlan Hunt
http://www.lachy.id.au/
lachlan.hunt (AT) lachy (DOT) id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.