Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > style for tags

Reply
Thread Tools

style for tags

 
 
Toby A Inkster
Guest
Posts: n/a
 
      09-07-2003
Michael Wilcox wrote:

> A "garbled" ad won't exist if you use CSS and HTML properly. Something
> like...
>
> <div id="advert">
> <span id="adhead">Heading Text</span><br>
> <img src="adimg.png" alt="Buy a new boat!" height="70" width="200">
> </div>


.... is total crap. Why claim to be demonstrating HTML and CSS properly but
give a complete abuse of both as an example.

First off, what is '<span id="adhead">Heading Text</span><br>' supposed to
mean? Answer: it adds no meaning to the document at all. For headings, use
<hX> elements -- that is why <hX> elements exist -- it is their entire
reason for existing -- why deny them their destiny? Instead use:

<div id="advert">
<h1>Heading Text</h1>
<img src="adimg.png" alt="Buy a new boat!" height="70" width="200">
</div>

this actually has *meaning*.

> ...would look just fine on an older/text/aural browser, and can look
> great on a visual browser by placing the following in the document's
> head:


Just a guess, but I doubt eBay would let you do that.

> font-size-increase: 120%;


Huh?

--
Toby A Inkster BSc (Hons) ARCS | (E-Mail Removed) | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:(E-Mail Removed)
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://(nothing)
 
Reply With Quote
 
 
 
 
Tony Cooper
Guest
Posts: n/a
 
      09-07-2003
On Sun, 07 Sep 2003 10:38:19 +0100, Toby A Inkster
<(E-Mail Removed)> wrote:

>Just a guess, but I doubt eBay would let you do that.


I'm not sure what you are referring to, but in an eBay ad one can use
HTML as the description and bypass the eBay text entry box.

When you do an eBay ad, the concern is not what eBay will allow you to
do, but how the reader will view the ad. In many categories, like the
ones I run ads in, the buyers are limited and the ad is usually viewed
by about 100 people or less. That doesn't give you much room to
exclude anyone because they are using an 800 x 600 screen or
something. An ad only runs for 7 days, and it can't be changed once a
single bid is made. One can't fiddle around until it's right. One
can't use large images that take too long to load. Anything other
than an image of the product is distracting. If it's something that
moves, flashes, or makes sounds, it annoys people.

It's a specialized application. Not that it's particularly difficult
or special, but I've seen some examples of overkill where some
whiz-bang "webmaster" tries to use a sledge hammer to kill a fly and
ends up with an ad that no one reads because it takes too long to load
or buries the important information in a load of distracting crap.




 
Reply With Quote
 
 
 
 
Toby A Inkster
Guest
Posts: n/a
 
      09-07-2003
Tony Cooper wrote:

> On Sun, 07 Sep 2003 10:38:19 +0100, Toby A Inkster
> <(E-Mail Removed)> wrote:
>
>> Just a guess, but I doubt eBay would let you do that.

>
> I'm not sure what you are referring to, but in an eBay ad one can use
> HTML as the description and bypass the eBay text entry box.


If you'd quoted a little more, you might have seen to what I was
referring:

> placing the following in the document's head


--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132
playing://the_all_seeing_i/walk_like_a_panther/02_beat_goes_on.ogg
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      09-08-2003
Tony Cooper <(E-Mail Removed)> wrote:

>In various books, and on various on-line tutorials, I see several
>different ways of writing the same thing:
>
><width=250>
><width= 250> (space between = and 250)
><width="250">


Those are all rubbish. But let's assume you simply forgot to include
the element name.

<table width=250>, etc.

In this case they are all correct. The space between the = and the
value makes no difference (nor does a space between attribute name and
the =).

However, not all values can be left unquoted. See
http://www.w3.org/TR/html401/intro/s...dx-attribute-6 for
the rules on when attribute values must be quoted.

In XHTML attribute values must always be quoted.

>I also see:
>
><width= 250 height= 100 font size= 6>
><width= 250 height= 100><font size= 6>
>
>What can be included within one set of < >, and what should be broken
>out into < > < >?


What are the HTML elements in question? font is not an attribute of
any HTML element, so your first example makes no sense. The font
element is also long deprecated and there is no need to use it in
pages created in 2003 so you second example is a diversion from the
real question.

Mark your content up with the appropriate HTML elements, adding those
attributes that actually exist for those elements and which are either
mandatory or needed by your content.

If you have a specific example where you can not decide whether to use
an attribute or not please post it.

Steve

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

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Dave Saville
Guest
Posts: n/a
 
      09-08-2003
On Mon, 08 Sep 2003 12:20:40 +0100, Steve Pugh wrote:

>What are the HTML elements in question? font is not an attribute of
>any HTML element, so your first example makes no sense. The font
>element is also long deprecated and there is no need to use it in
>pages created in 2003 so you second example is a diversion from the
>real question.
>
>Mark your content up with the appropriate HTML elements, adding those
>attributes that actually exist for those elements and which are either
>mandatory or needed by your content.


OK Steve - I have a question for you then. I have a site that holds
archives of newsletters. Each of which is a proper html doc in its own
right. The site also has a search facility - give it a string and it
will return a list of all newsletters that contain that string.
Clicking on a button for a particular newsletter pumps the existing
HTML through a script that puts a <font red> </font> either side of
every occurrence of string. In other words the search string is
highlighted wherever it occurs.

Now if <font> is depreciated and "bad style" how the heck do I do this?
My understanding is that I can't use a CSS, as that relates to a tag,
and I don't want to use *any* tag that will change the font style of
the doc - I just want to highlight that string - and don't want to
falsely highlight anything else.

So how?


Regards

Dave Saville

NB switch saville for nospam in address


 
Reply With Quote
 
Terry Orchard
Guest
Posts: n/a
 
      09-08-2003
Dave Saville wrote:

>I have a site that holds
>archives of newsletters. Each of which is a proper html doc in its own
>right. The site also has a search facility - give it a string and it
>will return a list of all newsletters that contain that string.
>Clicking on a button for a particular newsletter pumps the existing
>HTML through a script that puts a <font red> </font> either side of
>every occurrence of string. In other words the search string is
>highlighted wherever it occurs.
>
>Now if <font> is depreciated and "bad style" how the heck do I do this?
>My understanding is that I can't use a CSS, as that relates to a tag,
>and I don't want to use *any* tag that will change the font style of
>the doc - I just want to highlight that string - and don't want to
>falsely highlight anything else.


How about using <span class="searchhit"></span> around the word in
question, and include a span.searchhit entry in the stylesheet.

Terry
 
Reply With Quote
 
Dave Saville
Guest
Posts: n/a
 
      09-08-2003
On Mon, 08 Sep 2003 13:15:37 GMT, Terry Orchard wrote:

>>Now if <font> is depreciated and "bad style" how the heck do I do this?
>>My understanding is that I can't use a CSS, as that relates to a tag,
>>and I don't want to use *any* tag that will change the font style of
>>the doc - I just want to highlight that string - and don't want to
>>falsely highlight anything else.

>
>How about using <span class="searchhit"></span> around the word in
>question, and include a span.searchhit entry in the stylesheet.


Thank you Terry - I did not know about <span> - Seems a very flexible
tag. So as long as I can define a unique class then the doc using <span
class=something else> won't be affected? Cool.

Aren't these NGs great

Regards

Dave Saville

NB switch saville for nospam in address


 
Reply With Quote
 
Tony Cooper
Guest
Posts: n/a
 
      09-08-2003
On Mon, 08 Sep 2003 12:20:40 +0100, Steve Pugh <(E-Mail Removed)> wrote:

>Tony Cooper <(E-Mail Removed)> wrote:
>
>>In various books, and on various on-line tutorials, I see several
>>different ways of writing the same thing:
>>
>><width=250>
>><width= 250> (space between = and 250)
>><width="250">

>
>Those are all rubbish. But let's assume you simply forgot to include
>the element name.
>
><table width=250>, etc.
>
>In this case they are all correct. The space between the = and the
>value makes no difference (nor does a space between attribute name and
>the =).
>
>However, not all values can be left unquoted. See
>http://www.w3.org/TR/html401/intro/s...dx-attribute-6 for
>the rules on when attribute values must be quoted.
>
>In XHTML attribute values must always be quoted.
>
>>I also see:
>>
>><width= 250 height= 100 font size= 6>
>><width= 250 height= 100><font size= 6>
>>
>>What can be included within one set of < >, and what should be broken
>>out into < > < >?

>
>What are the HTML elements in question? font is not an attribute of
>any HTML element, so your first example makes no sense. The font
>element is also long deprecated and there is no need to use it in
>pages created in 2003 so you second example is a diversion from the
>real question.
>
>Mark your content up with the appropriate HTML elements, adding those
>attributes that actually exist for those elements and which are either
>mandatory or needed by your content.
>
>If you have a specific example where you can not decide whether to use
>an attribute or not please post it.


Thanks for your reply. My examples were poorly chosen, but I was
trying for examples where the part of the line that was not in
question would not distract. So, I deliberately left out the img
src attribute. I just wasn't thinking when I put the font size in
that same line. These are not real lines that I'd use. Just trying
for an example.


Let me try again...if the sets to be included are

font face="arial, helvetica"
font size ="6"
bold
bgcolor="#cccccc"

and so on, what would the best way to handle it. Each could be within
< >, or several could be within the < >. Which is better, and why?

There is no particular combination that I'm asking about. I'm just
looking for a general rule for what should be in one set of < >. If
you reply to this, try to stay away from the example (which may be a
bad one) and reply to the concept which is "what can be included in
one set of < >?" (when it pertains to the same general thing)

As to the font element being deprecated, I've been using "font size=
x". It works, I've never seen a real reason not to use it. I don't
need or use CSS since I'm really not doing a web page, but just a
small ad with a short life.

I'm a little surprised at the intensity of comment over this. If
something works, and it doesn't interface with anything else, why is
it a problem? I'm not trying to argue about it, but really curious
about why it's a concern.

To run on a bit, I started with HTML a couple of months ago, and - yes
- I learned what I have learned from a book and from some on-line
tutorials.

The problem with learning this way is that each step is presented
separately. The book says if you want the font to be bold, you write
<b> on one side and </b> on another. Later, the book says if you want
the font to be italic, you write <i> on one side and </i> on the
other. The book never says it's best, or not right, to write <b i> if
you want both. The book doesn't tie one thing into the next thing.
Trial and error says that doesn't work, but each combination then
becomes trial and error. So, the question here is to try to determine
some rule of thumb that saves the trial and error process from each
combination.

The second problem with learning from a book is that the average book
is $30 to $50, and out of date quicker than a woman's hem line. When
you are not employed in the field, and just doing small projects, you
end up using whatever is in that book (ie: font size="x") as long as
it works. Ask a question based on that level, and people come down
on you.












 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      09-08-2003
Tony Cooper <(E-Mail Removed)> wrote:

>Let me try again...if the sets to be included are
>
>font face="arial, helvetica"
>font size ="6"
>bold
>bgcolor="#cccccc"


The first two should be combined as a single font element, assuming
you want _all_ the contained text to be in Arial and
extra-extra-large.

Bold is <b>. No attributes involved at all.

bgcolor is only a valid attribute on <body>, <table>, <tr>, <td> and
<th> and so van not be combined with the others anyway.

>and so on, what would the best way to handle it. Each could be within
>< >, or several could be within the < >. Which is better, and why?


Only the first two you list can be combined.

>There is no particular combination that I'm asking about. I'm just
>looking for a general rule for what should be in one set of < >.


Each <...> is either-
the start tag of an element (with none or some attributes) or
the end tag of an element.

Looking at start tags. The text immediately after the < is the name of
the element. Any text following that is an attribute.

<img src="foo" alt="bar"> is an img element with src and alt
attributes. You can not write this as <src="foo" img alt="bar">.

> If
>you reply to this, try to stay away from the example (which may be a
>bad one) and reply to the concept which is "what can be included in
>one set of < >?" (when it pertains to the same general thing)


What do you mean the same thing?

>As to the font element being deprecated, I've been using "font size=
>x". It works, I've never seen a real reason not to use it. I don't
>need or use CSS since I'm really not doing a web page, but just a
>small ad with a short life.


Are you saying that you will never, ever make a full web page?

If you ever want to make a proper web page you will want to know how
to do so to the best of your ability, won't you? So why not learn how
to do things better now before you pick up too many bad habits? For a
lot of the people on this newsgroup there was a period when they had
to unlearn a lot of things. But you have the advantage that you're
leaning now, not back in the 90s, and can learn the better way of
doing things straight off.

CSS is easier to update, takes less bandwidth and is more flexible.

>I'm a little surprised at the intensity of comment over this. If
>something works, and it doesn't interface with anything else, why is
>it a problem? I'm not trying to argue about it, but really curious
>about why it's a concern.


It's about separation of content from presentation. HTML is for
marking up content (it says what something _is_, i.e. it's mostly
about nouns). CSS is for giving a presentation to that content (it
says what something looks or sounds like, i.e. it's mostly about
adjectives).

>The problem with learning this way is that each step is presented
>separately. The book says if you want the font to be bold, you write
><b> on one side and </b> on another. Later, the book says if you want
>the font to be italic, you write <i> on one side and </i> on the
>other. The book never says it's best, or not right, to write <b i> if
>you want both.


<b i> does not exist.
There is no i attribute of the bold element.
No book can mention all the things that don't exist.

You seem to be suffering some confusion about what an element is and
what and attribute is.

HTML is composed of elements. These are marked up with start and end
tags thus:
<element>...</element>

<b></b> and <i></i> are both elements.

Most elements have a number of attributes that are added to the start
tag of the element. These take the form of attribute="value"

The full element is start tag (plus attributes), content, end tag.
Always think of your HTML in terms of elements.

>The book doesn't tie one thing into the next thing.
>Trial and error says that doesn't work, but each combination then
>becomes trial and error. So, the question here is to try to determine
>some rule of thumb that saves the trial and error process from each
>combination.


http://www.w3.org/TR/html401/

A full list of elements -
http://www.w3.org/TR/html401/index/elements.html

A full list of attributes and which elements they can be used on -
http://www.w3.org/TR/html401/index/attributes.html

A validator to check that your code is valid -
http://validator.w3.org/

Steve


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

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      09-08-2003
"Dave Saville" <(E-Mail Removed)> wrote:
>On Mon, 08 Sep 2003 12:20:40 +0100, Steve Pugh wrote:
>
>>What are the HTML elements in question? font is not an attribute of
>>any HTML element, so your first example makes no sense. The font
>>element is also long deprecated and there is no need to use it in
>>pages created in 2003 so you second example is a diversion from the
>>real question.
>>
>>Mark your content up with the appropriate HTML elements, adding those
>>attributes that actually exist for those elements and which are either
>>mandatory or needed by your content.

>
>OK Steve - I have a question for you then. I have a site that holds
>archives of newsletters. Each of which is a proper html doc in its own
>right. The site also has a search facility - give it a string and it
>will return a list of all newsletters that contain that string.
>Clicking on a button for a particular newsletter pumps the existing
>HTML through a script that puts a <font red> </font> either side of
>every occurrence of string. In other words the search string is
>highlighted wherever it occurs.


You want to highlight the text. Sounds like a form of emphasis to me.
So use <em class="searchterm">...</em> with the appropirate style.
e.g.
em.searchterm {
font-style: inherit;
color: #ff0000;
background-color: #ffffff;
}

>Now if <font> is depreciated


It's not depreciated. It's deprecated. They mean very different
things.

>and "bad style" how the heck do I do this?
>My understanding is that I can't use a CSS, as that relates to a tag,
>and I don't want to use *any* tag that will change the font style of
>the doc - I just want to highlight that string - and don't want to
>falsely highlight anything else.


Check any good CSS tutorial to learn about classes.

Steve

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

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
JSP newbie - use include, custom tags, standard tags - or what? Mike Java 3 01-09-2004 09:30 AM
RegEx to find CFML tags nested in HTML tags Dean H. Saxe Perl 0 01-03-2004 06:11 PM
Custom Tags within Custom Tags. Ranganath Java 2 10-21-2003 06:14 AM



Advertisments