473,480 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

two, possibly off-topic, questions

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
Jul 20 '05 #1
6 1642
"Maury Merkin" <me****@his.com> wrote:
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.
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.
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.
(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.
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?
(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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #2
Steve Pugh <st***@pugh.net> wrote:
"Maury Merkin" <me****@his.com> wrote:


re: <iframe> question
(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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
On Sun, 06 Jun 2004 11:35:39 -0400, Maury Merkin <me****@his.com> wrote:
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.
Jul 20 '05 #4
"Maury Merkin" <me****@his.com> wrote in
comp.infosystems.www.authoring.stylesheets:
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/
Jul 20 '05 #5
"Maury Merkin" <me****@his.com> wrote:
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)..
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.
Jul 20 '05 #6
Maury Merkin wrote:
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.
(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/
la**********@lachy.id.au.update.virus.scanners

Remove .update.virus.scanners to email me,
NO SPAM and NO VIRUSES!!!
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1168
by: PeteC | last post by:
I've got a dedicated server running Windows 2003, IIS, MySQL and PHP. I'm working on a web site which needs to pick data up on a semi-regular basis from a CSV file which will exist in a directory...
0
1072
by: MsOsWin | last post by:
http://www.google.com/search?hl=en&lr=&ie=ISO-8859-1&safe=off&as_qdr=all&q=inurl%3Afeeds+site%3Agroups- beta.google.com
8
1654
by: Adrienne | last post by:
The elements MENU and DIR were in the HTML 2.0 spec, and disappeared in 4. I would like to have them back, they makes sense. For example: <menu> <li>Home</li> <li>Contact</li> </menu> ...
1
1274
by: ChrisC | last post by:
I have my aspx page that contains an iframe. when I navigate the iframe to other places by changing the src attribute on a button click from the .net portion of the page I lose all viewstate...
2
2137
by: Poly-poly man | last post by:
I am working on a GTK Midi player (timidgtk.sourceforge.net). As you can see, it's just a timidity frontend. With version 0.03, I'm trying to devel it to use SDL_sound to play the midis. First...
4
1889
by: Jim Langston | last post by:
In my program I am accepting messages over the network and parsing them. I find that the function that does this has gotten quite big, and so want to break the if else code into functions. I...
8
2176
by: subramanian100in | last post by:
Suppose I have #include <stdio.h> #include <string.h> size_t strlen(const char *str) { printf("from strlen - %s\n", str); return 0; // return some dummy value
6
1695
by: Designing Solutions WD | last post by:
I have the following table. GO /****** Object: Table . Script Date: 05/01/2007 10:42:31 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
7
1636
by: Erwin Moller | last post by:
Hi group, Does anybody know what causes the following Warning? __________________________________________________ Warning: Unknown(): Your script possibly relies on a session side-effect...
7
7337
by: ghjk | last post by:
I developed web application using php. But some pages display a error message. Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that...
0
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4478
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.