473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

span + Css

Hi all,

I'm having a small but a quite upseting problem using Css and the <span>
tag.
I've set up a style for the extract of some articles that goes like this :

..Texte {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-weight: normal;
color: #000000;
text-align: justify;
}

But as you can see here :
http://www.asseto.com/iw/industry-we...ites/index.asp

The four articles at the top of the page suffer an extra spacing between the
two last lines.

At first I thought it was because of the tiny arrow image, but I took it off
and nothing changed.

Here is the html of one of those :
-----------------------------------------------
<td valign="top" align="justify">
<span class="ExtractTitre">Gaz de France construit à Fos un nouveau
methanier</span><br>
<span class="Texte">Suite à la signature, été 2002, d'un contrat d'
approvisionnement en gaz naturel entre la France et l'Egypte, Gaz de France
étudie la construction d'un second terminal méthanier sur le site de Fos sur
mer ,dans ...&nbsp;<img
src="../../images/images-gsi/fleche-bleue-petite2.gif" width="7"
height="9">&nbsp;<a href="popup-actualite.asp?ActualiteId=190"><span
class="ExtractTitre">lire</span></a></span>
</td>
-------------------------------------------------

If anyone has an idea, I would be very grateful.

Regards Yahel.

Jul 20 '05 #1
9 2452
On Mon, 16 Feb 2004 17:27:14 +0200, "Yahel" <yahel@wanadoo_NOSPAMM_.fr>
wrote:
I'm having a small but a quite upseting problem using Css and the <span>
tag.
I've set up a style for the extract of some articles that goes like this :

.Texte {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-weight: normal;
color: #000000;
text-align: justify;
}

But as you can see here :
http://www.asseto.com/iw/industry-we...ites/index.asp

The four articles at the top of the page suffer an extra spacing between the
two last lines.


I think you'll find it's due to your &nbsp; characters, which aren't
within any of your spans. They are therefore presumably inheriting some
text size from further up. You would do better to set a class on your
TD's to define the text for the cell as a whole, including size, and use
spans for setting the font weight and colour of individual passages
which differ. Better still: define the font once for the table as a
whole, and put the texts such as "Grands projets" within a heading. (H2
probably, but you haven't got an H1 at present.)

Some more (strong) recommendations:

- take the logo at the top out of the table. Putting it in a table gains
you nothing, clutters your markup, and prevents you taking advantage of
my next point.

- scrap all the width attributes on the table. Let the reader's browser
sort out how much space is available for display. (Several people here
would recommend scrapping the table completely and using CSS
positioning, but I suggest you concentrate on walking properly before
you try running.)

- avoid specifying font sizes in pixels. Your text is almost unreadable
for me. See http://www.xs4all.nl/~sbpoley/webmatters/fontsize.html

- avoid Verdana. See
http://www.xs4all.nl/~sbpoley/webmatters/verdana.html

- put some ALT texts in. Without images, your page looks a terrible
mess. See http://www.xs4all.nl/~sbpoley/webmatters/alt.html (I'm not
trying to plug my site BTW - it's just that these points come up so
often that it's easier to explain it once on a web page than repeat
myself a hundred times on Usenet.)

- learn to use CSS margins/padding, so you don't need monstrosities
like:

<tr>
<td>&nbsp;</td>
<td height="30">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

This could be replaced by a simple "margin-bottom: 4em;" or something
similar.

- No need to define font-family over and over again in your stylesheet.
Define it once for BODY and the rest will inherit.

Hope this helps.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #2
On Mon, 16 Feb 2004, Stephen Poley wrote:
- put some ALT texts in. Without images, your page looks a terrible
mess. See http://www.xs4all.nl/~sbpoley/webmatters/alt.html


If I might make a small, but IMHO significant, comment on this page.

You rightly point out that:

The purpose of the ALT attribute is thus to provide in textual form
whatever information was provided by the image.

which I think expresses the requirement very well.

When you quote the HTML specification, however, you seem to make no
mention of the key part of section 13.8
http://www.w3.org/TR/html401/struct/....html#adef-alt

Several non-textual elements (IMG, AREA, APPLET, and INPUT) let
authors specify alternate text to serve as content when the element
^^^^^^^^^^^^^^^^
cannot be rendered normally.

I would want to emphasise that apt phrase "to serve as content" -
*NOT* "to describe the content", as all too many folks seem to
misinterpret it. And the worst part is that you have quoted this most
unfortunate comment from the DTD:

alt %Text; #REQUIRED -- short description --

without any adverse comment. I put it to you that a "short
description" is NOT the role of the alt attribute, and that this
comment (I can say this with impunity, since comments in the DTD are
non-normative ;-) is frankly a blunder. If you quote it at all, then
I urge you to pass some kind of adverse comment on it.
By way of a cautionary tale, I give you snippets of a recent
discussion with a web page author who IMHO had got this desperately
wrong. His pages had large numbers of transparent GIFs, each
carefully provided with alt="for layout only". It looked (and
sounded) absolutely ridiculous on a text browser.

In response to my repeated criticism, at first rejected as "we're
conforming to Bobby", he finally wanted to know what I would put
there. I innocently replied that, since the function of the
transparent GIFs was evidently to provide some white space, it seemed
obvious (if he couldn't be persuaded to abandon the transparent
GIFs altogether) that the appropriate alt text would be some white
space.

His reply was that he couldn't understand how alt="some white space"
could be any better than alt="for layout only". So help me!
Jul 20 '05 #3
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote in
news:Pi*******************************@ppepc56.ph. gla.ac.uk:
In response to my repeated criticism, at first rejected as "we're
conforming to Bobby", he finally wanted to know what I would put
there. I innocently replied that, since the function of the
transparent GIFs was evidently to provide some white space, it seemed
obvious (if he couldn't be persuaded to abandon the transparent
GIFs altogether) that the appropriate alt text would be some white
space.

His reply was that he couldn't understand how alt="some white space"
could be any better than alt="for layout only". So help me!


Didn't something like this occur in the first installment of a trilogy by
R.R.J Neiklot? Set outside the Setag fo Airom, IIRC.
Jul 20 '05 #4
Well thank you for that "Full of interesting informations" answer : )

Just a question that occurs to me as a non-specialist ... How many people
using only text based browser do you know ? : )

Thanks a lot again, i'll take a deep look at your pages : )

Regards Yahel.

"Yahel" <yahel@wanadoo_NOSPAMM_.fr> a écrit dans le message de news:
c0**********@news-reader1.wanadoo.fr...
Hi all,

I'm having a small but a quite upseting problem using Css and the <span>
tag.
I've set up a style for the extract of some articles that goes like this :

.Texte {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 9px;
font-weight: normal;
color: #000000;
text-align: justify;
}

But as you can see here :
http://www.asseto.com/iw/industry-we...ites/index.asp

The four articles at the top of the page suffer an extra spacing between the two last lines.

At first I thought it was because of the tiny arrow image, but I took it off and nothing changed.

Here is the html of one of those :
-----------------------------------------------
<td valign="top" align="justify">
<span class="ExtractTitre">Gaz de France construit à Fos un nouveau
methanier</span><br>
<span class="Texte">Suite à la signature, été 2002, d'un contrat d'
approvisionnement en gaz naturel entre la France et l'Egypte, Gaz de France étudie la construction d'un second terminal méthanier sur le site de Fos sur mer ,dans ...&nbsp;<img
src="../../images/images-gsi/fleche-bleue-petite2.gif" width="7"
height="9">&nbsp;<a href="popup-actualite.asp?ActualiteId=190"><span
class="ExtractTitre">lire</span></a></span>
</td>
-------------------------------------------------

If anyone has an idea, I would be very grateful.

Regards Yahel.

Jul 20 '05 #5
On Mon, 16 Feb 2004 22:47:53 +0000, "Alan J. Flavell"
<fl*****@ph.gla.ac.uk> wrote:
You rightly point out that:

The purpose of the ALT attribute is thus to provide in textual form
whatever information was provided by the image.

which I think expresses the requirement very well.

When you quote the HTML specification, however, you seem to make no
mention of the key part of section 13.8
http://www.w3.org/TR/html401/struct/....html#adef-alt

Several non-textual elements (IMG, AREA, APPLET, and INPUT) let
authors specify alternate text to serve as content when the element
^^^^^^^^^^^^^^^^
cannot be rendered normally.

I would want to emphasise that apt phrase "to serve as content" -
*NOT* "to describe the content", as all too many folks seem to
misinterpret it. And the worst part is that you have quoted this most
unfortunate comment from the DTD:

alt %Text; #REQUIRED -- short description --

without any adverse comment. I put it to you that a "short
description" is NOT the role of the alt attribute, and that this
comment (I can say this with impunity, since comments in the DTD are
non-normative ;-) is frankly a blunder. If you quote it at all, then
I urge you to pass some kind of adverse comment on it.


Yes, I agree. Thanks for pointing that out. I have updated the page.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #6
On Tue, 17 Feb 2004 15:02:41 +0200, "Yahel" <yahel@wanadoo_NOSPAMM_.fr>
wrote:
Well thank you for that "Full of interesting informations" answer : )
You're welcome.
Just a question that occurs to me as a non-specialist ... How many people
using only text based browser do you know ? : )
Approximately 100%, seeing that just about everyone I know uses search
engines, and search robots are in essence a text-based browser.

OK, taking your question a bit more as it was intended: visit the Usenet
groups for blind users and you'll meet quite a few. In addition I know
quite a few people (including me) who usually disable images when
surfing, to speed up download time. As most of the images on your page
were basically decorative, it won't take much effort to insert
appropriate ALT attributes.
Thanks a lot again, i'll take a deep look at your pages : )


Good luck. Feel free to ask if you have questions.
--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 20 '05 #7
On Tue, 17 Feb 2004 15:02:41 +0200, Yahel <yahel@wanadoo_NOSPAMM_.fr>
wrote:
Just a question that occurs to me as a non-specialist ... How many people
using only text based browser do you know ? : )


How many people use Google? ;)
Jul 20 '05 #8
"Alan J. Flavell" <fl*****@ph.gla.ac.uk> wrote in
news:Pi*******************************@ppepc56.ph. gla.ac.uk:
In response to my repeated criticism, at first rejected as "we're
conforming to Bobby", he finally wanted to know what I would put
there. I innocently replied that, since the function of the
transparent GIFs was evidently to provide some white space, it seemed
obvious (if he couldn't be persuaded to abandon the transparent
GIFs altogether) that the appropriate alt text would be some white
space.

His reply was that he couldn't understand how alt="some white space"
could be any better than alt="for layout only". So help me!


Help would require replacing the individual in question with one
possessing $clue. Or applying a cluestick to said individual's head.

In seriousness, for contentless (i.e. layout) images, alt="" is
appropriate since in most text browsers it will prevent any indication
of the image being shown, not even an [IMAGE].

--
| Andrew Glasgow <amg39(at)cornell.edu> |
| "SCSI is *NOT* magic. There are *fundamental technical reasons* why it |
| is necessary to sacrifice a young goat to your SCSI chain now and then." |
| -- John Woods |
Jul 20 '05 #9
On Thu, 19 Feb 2004, Andrew Glasgow wrote:
In seriousness, for contentless (i.e. layout) images, alt="" is
appropriate
But sometimes it's necessary for the image to be replaced by some
textual white space, which was the point that I was making.
otherwise the texts that are to the left and right of the image may
get run together.

I've always found that alt=" " works well enough for that, but
I've seen suggestions that alt="&nbsp;" would be more robust.

OTOH I've seen some old browsers which displayed alt="&nbsp;" as an
ugly rectangular box.
since in most text browsers it will prevent any indication
of the image being shown, not even an [IMAGE].


Oh, indeed.
Jul 20 '05 #10

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

Similar topics

7
by: deko | last post by:
How to change a link's color based on a php variable? I have a number of links on a page: <p><a href="page1.php">Page 1</a></p> <p><a href="page2.php">Page 2</a></p> <p><a...
13
by: Mikko Ohtamaa | last post by:
From XML specification: The representation of an empty element is either a start-tag immediately followed by an end-tag, or an empty-element tag. (This means that <foo></foo> is equal to...
5
by: Kathryn | last post by:
Good morning! I am having a problem with a span. I have items, of which I only want to show the first X characters on the screen. If the user prints the page, I want the entire item to print....
9
by: developer | last post by:
Does anyone know what is the way IE treats span tags(<span>) and table tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if it placed with other elements that are in a table? Can...
1
by: developer | last post by:
Does anyone know what is the way IE treats span tags(<span>) and table tags(<tr>, <td>)? Should the <span> tag be encolsed in tds and trs if it placed with other elements that are in a table? Can...
2
by: Alex | last post by:
On my page I have a lot string like this: <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc1</span> <span onmouseover="callMe(this)" onmouseout="callMe(null)" >abc2</span> <span...
5
by: ste.paoletti | last post by:
I have a problem with css I have a this xhtml code: <span> <span> <span/> <input type="radio"/> .... <span/> <input type="button" onclick ="var s=document.createElement('span');...
2
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems...
1
by: msg2ajay | last post by:
hello , i have to pass a 'span' id to the javascript function'. how can i pass that. when i tried like below it is working!!! may the function is in the same page.... eg: ---- ...
5
by: Brent | last post by:
Take this small HTML fragment: span.theClass{float:left;width:100px;cursor:pointer;cursor:hand;} ------------------------ <div> <span id="1" class="theClass">&nbsp;<span> <span id="2"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.