473,788 Members | 2,725 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Want to remove img-border w/ xhtml, not html

I want to make sure that no border (around a specific small "blog-button"
image) ever appears in FF or IE, or any other browswer. I couldn't seem do
it with xhtml, so I reverted to

border="0"

inside the "img" tag. This of course does not validate as xhtml. it does
what I want it to do (gets rid of the border, in both browsers), but I want
all my code to be validated, well-formed xhtml.

How might I do this correctly using either xhtml or css?

The image in question is at <http://rjbox.net, about halfway down the
page.

The code in question is here:

99 Should you happen to agree with this you&rsquo;ll appreciate the
100 philosophy over at <a href="http://no-www.org"><img
101 src="http://no-www.org/images/blog-button.gif"
102 alt=" No-www.org "
103 title=" No-www.org "
104 border="0" /></a: “Succinctl y, use of the www subdomain is
105 redundant and time consuming to communicate. The internet, media, and
106 society are all better off without it.”&nbsp;<br /><br />

--
// rj@panix.com //

Jan 14 '07 #1
21 6522
Russell Hoover wrote:
I want to make sure that no border (around a specific small "blog-button"
image) ever appears in FF or IE, or any other browswer. I couldn't seem do
it with xhtml, so I reverted to

border="0"

inside the "img" tag. This of course does not validate as xhtml.
It doesn't validate as HTML 4.01 strict either.
it does
what I want it to do (gets rid of the border, in both browsers), but I want
all my code to be validated, well-formed xhtml.
When people say that here, someone invariably comes along and asks /why/
you want that. Usually the poster doesn't know, or thinks they know
(they want the most current code). Be aware (perhaps you already are)
that XHTML is not all it's cracked up (or talked up) to be. Chances are,
you really ought to be using HTML 4.01 Strict. Especially since... well,
see my comments below.
>
How might I do this correctly using either xhtml or css?
You make it sound like they're mutually exclusive. They're not; use both.
>
The image in question is at <http://rjbox.net, about halfway down the
page.
You were close; use a img { border-style: none; } . This will apply to
all the images in links rather than just the one you asked about, but
that's what this particular page specifies anyway.

Maybe I also be so bold as to offer a few other comments? Since you're
already styling (and you seem to care so much about "good XHTML"), get
rid of the extra <brtags everywhere. First of all, they are not XHTML
either: you need to close all elements, here with <br/>. Second of all,
you don't need them and they are neither semantically correct nor
flexible. Where you want to modify spacing for an element, use a margin
(or padding) style. E.g., p {margin-bottom: 2em;}.

Of course, you'll then have to add actual <ptags. Seems you haven't
really marked up your code at all. Most of the text is a big long DIV:
<div class="justify" >. Trade that in for a <p>, add <pand </ptags to
deliminate paragraphs (that's what they're for), and style the <pwith
align:justify (I prefer align:left because justify can be hard to read,
but you choose. If you change your mind you can change it quickly in one
place, the .css file).

Your CSS rules for a elements should be in the order
link-visited-hover-active, otherwise the cascading won't work out the
way you probably expect. (Google for "Las Vegas Has Animals" ...)

On all your images, you can apply an id and then style the dimensions.
Replace height="37" width="90" with CSS:
#vimimg { height:37px; width:90px; }

Also, you might rethink your alt content. The titles are okay ("Built
with Vim"), but for an alt attribute I'd put something like "Vim logo"
because, well, that's what the image is. In any case, I would definitely
get rid of the extra spaces in the alt texts; I don't know how screen
readers react to them.

You have a bunch of &nbsp in your <title>. What line-breaking do you
expect the title to suffer without them? In any case, I believe &nbsp;
is not valid XHTML. Check the W3C docs.

Your meta tags are not self-closed as XHTML requires, either.

You're serving to all user-agents as Content-Type: text/html.

I'm more convinced than ever that you ought to just replace your doctype
with one for HTML 4.01 strict, validate it, and relax.

HTH. GL!
--
John
Jan 14 '07 #2
Scripsit John Hosking:
You were close; use a img { border-style: none; }
Was he? After your analysis of the page, I'm reluctant to take any look at,
so I can't tell whether there's anything close to this CSS construct there.

Anyway, it does not really satisfy the request "I want to make sure that no
border (around a specific small "blog-button" image) ever appears in FF or
IE, or any other browswer." Surely a user style sheet like
a img { border-style: solid !important; }
(or an equivalent browser setting) beats the rule in the author's style
sheet.

Of course, the request was utterly foolish, as is the idea of using a
button-like image instead of a link inside text. By the way, when
"successful ", removing the border also removes the essential distinction
between visited and unvisited (and hovered and active) links.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jan 14 '07 #3
John Hosking <Jo**@DELETE.Ho sking.name.INVA LIDwrites:
Also, you might rethink your alt content. The titles are okay ("Built
with Vim"), but for an alt attribute I'd put something like "Vim logo"
because, well, that's what the image is.
I'd completely disagree - if the purpose of the image (when visible)
is to say that the document is built with Vim, then the alt text
should be "Built with Vim".

If the purpose of the image is to show what the Vim logo looks like,
then "Vim logo" might be okay, though "The Vim logo is
[description]" would probably be better.

I think the general best rule for alt text is to consider what text
you *would* place there if someone had deleted all your image folders
and you wanted the page to still make sense to readers while the image
was retrieved from backups.

--
Chris
Jan 14 '07 #4
..oO(John Hosking)
>Also, you might rethink your alt content. The titles are okay ("Built
with Vim"), but for an alt attribute I'd put something like "Vim logo"
Nope.
>because, well, that's what the image is.
The 'alt' attribute doesn't describe the image, but _replaces_ it in
case the image can't be shown.

Micha
Jan 14 '07 #5
Chris Morris wrote:
John Hosking writes:
>>Also, you might rethink your alt content. The titles are okay ("Built
with Vim"), but for an alt attribute I'd put something like "Vim logo"
because, well, that's what the image is.

I'd completely disagree - if the purpose of the image (when visible)
is to say that the document is built with Vim, then the alt text
should be "Built with Vim".
Okay, but you don't have to *completely* disagree. ;-)

In any case, if we go with this argument, he should put "Created with
Vim," because that is the phrase it turns out actually appears on the
image. But I started with the assumption that if the meaningful content
represented by that gif is exactly the same as the discernible text in
the image, then the gif might as well be replaced with the actual text,
"Created with Vim." But since the gif is there, it must be to catch the
eye with the graphical smoothness and worldwide recognition of the Vim
logo. Here's a compromise suggestion: alt="'Created with Vim' logo".
>
If the purpose of the image is to show what the Vim logo looks like,
then "Vim logo" might be okay, though "The Vim logo is
[description]" would probably be better.
Okay, except I suppose neither of us expect anyone to care about a
design description of the logo. More likely is that the purpose is to
use the recognition value of the logo. *Most* likely is that he put the
gif on his page because he could. ;-)
>
I think the general best rule for alt text is to consider what text
you *would* place there if someone had deleted all your image folders
and you wanted the page to still make sense to readers while the image
was retrieved from backups.
That sounds like a good rule. My rule has been to put some clue as to
what the image *is* (without so much about why it's there). The title
attribute can provide a hint as to what the image *represents*. I'll
have to think about your rule, though. What do blind visitors want? What
do screen readers work best with?

--
John (disagreeing only *partially*, at most)
Jan 14 '07 #6
John Hosking <Jo**@DELETE.Ho sking.name.INVA LIDwrites:
That sounds like a good rule. My rule has been to put some clue as to
what the image *is* (without so much about why it's there). The title
attribute can provide a hint as to what the image *represents*. I'll
have to think about your rule, though. What do blind visitors want?
What do screen readers work best with?
Having tried screen readers a bit, I think it's about the same as for
text browsers - it works better if there's no obvious clue that
there's an image there at all (in general: exceptions for thumbnails,
galleries, etc. where the image(s) are the major part of the content).

There's trial versions of screen readers and speech browsers freely
available (JAWS and IBM Home Page Reader seem to be two commonly used
ones) - I'd recommend downloading them and trying them out (with the
monitor off, of course!). Once you've tried them and know roughly what
it feels like to use them, you can probably then manage simulating
them with a text browser such as Lynx.

(I don't recommend just using Lynx without trying a speech-based
browser at all, because while what they can parse and display is
similar, the display method is very different, and that does need
considering)

--
Chris
Jan 14 '07 #7
Michael Fesser wrote:
.oO(John Hosking)

>>Also, you might rethink your alt content. The titles are okay ("Built
with Vim"), but for an alt attribute I'd put something like "Vim logo"


Nope.

>>because, well, that's what the image is.


The 'alt' attribute doesn't describe the image, but _replaces_ it in
case the image can't be shown.
Hello Micha

You seem to take the same view as Chris Morris, the value of which I can
easily see (um, not just agreeing with Chris, I mean the actual
viewpoint...).

I think I have been working from my readings which included the page at
http://www.access-board.gov/sec508/g...194.22.htm#(a), which contains
as example (sadly, there aren't more):
HTML Source Code: <img src="art/logo-green.gif" alt="Access Board Logo">

Even fewer examples(!) are to be found at the W3C:
http://www.w3.org/TR/WAI-WEBCONTENT/...ext-equivalent
http://www.w3.org/TR/WAI-WEBCONTENT-...ext-equivalent
http://www.w3.org/TR/WCAG10-CORE-TECHS/#text-equivalent
the above last includes this: "A good test to determine if a text
equivalent is useful is to imagine reading the document aloud over the
telephone. What would you say upon encountering this image to make the
page comprehensible to the listener?" On the phone I'd have to say,
"...and then there's a logo that says 'Created with Vim'."
The only example I found on the W3C accessiblity pages is at
http://www.w3.org/TR/WCAG10-HTML-TEC...ext-equivalent, namely
Example <IMG src="magnifying glass.gif" alt="Search">

So, as I now see it, the United States Access Board tends to think more
literally, while the W3C is leaning toward the functionality/useful
purpose of an image or object. Of course, they both could have offered
more discussion about good and bad examples.

Thanks to you and Chris for challenging my ideas about alt texts; it's
given me something to think about on my future pages.

--
John
Jan 14 '07 #8
Chris Morris wrote:
>
Having tried screen readers a bit, I think it's about the same as for
text browsers - it works better if there's no obvious clue that
there's an image there at all (in general: exceptions for thumbnails,
galleries, etc. where the image(s) are the major part of the content).
Thanks, Chris, for this and your earlier response. See also my response
to Michael Fresser.
>
There's trial versions of screen readers and speech browsers freely
available (JAWS and IBM Home Page Reader seem to be two commonly used
ones) - I'd recommend downloading them and trying them out (with the
monitor off, of course!). Once you've tried them and know roughly what
it feels like to use them, you can probably then manage simulating
them with a text browser such as Lynx.
I was going to ask you where I can get them and especially, what
differences were pertinent between the two, but then I thought I'd spare
you, and Google a little on my own. The very first hits I got included
the phrase "IBM Home Page Reader is Dead." Apparently, IBM is
discontinuing Home Page Reader. So I guess that's *one* difference...
>
(I don't recommend just using Lynx without trying a speech-based
browser at all, because while what they can parse and display is
similar, the display method is very different, and that does need
considering)
I've been using a Lynx emulator for a few years, with some enlightening
results, but I see it's not the be-all and end-all. Thanks again.

--
John
Jan 14 '07 #9
John Hosking <Jo**@DELETE.Ho sking.name.INVA LIDwrites:
I was going to ask you where I can get them and especially, what
differences were pertinent between the two, but then I thought I'd
spare you, and Google a little on my own. The very first hits I got
included the phrase "IBM Home Page Reader is Dead." Apparently, IBM is
discontinuing Home Page Reader. So I guess that's *one* difference...
If IBM aren't providing it any more, you can download the trial
version from http://browsers.evolt.org - even if it's no longer
developed then it'll still give you an idea of what it's like to use
audio-based browsing.

HPR was a speech browser (it used IE to do the HTTP side of things),
whereas JAWS and similar are screen readers (and so can be used with
applications other than web browsing). I thought a trial version of
JAWS was available, but maybe not. It probably doesn't matter too much
*which* screen reading software you test with, though (though JAWS did
do a little bit better when combined with IE).
I've been using a Lynx emulator for a few years, with some
enlightening results, but I see it's not the be-all and
end-all. Thanks again.
A Lynx emulator? Why not just use Lynx - it's available for all major
operating systems.

--
Chris
Jan 14 '07 #10

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

Similar topics

1
2118
by: Kenneth | last post by:
I am trying to remove a record from the database but it is not working. Here is my code: --------------------------------------------------------------------- <?php require_once('Connections/myDB.php'); ?> <?php mysql_select_db($database_myDB, $myDB); $query_Recordset1 = "SELECT * FROM signup";
9
41462
by: Daniel | last post by:
Hi I'd like to discuss the following problem: How to remove the space between two images (img)? <img alt="First" src="first.gif"> <img alt="Second" src="second.gif"> I tried:
7
27288
by: wk | last post by:
Hi, I have a seemingly simple html code which has two tables one under another, and both have an image of same size...but the table row also has some text, which seems to be creating a small gap between the two images on display. Can anybody tell me how to remove the thin gap between the two images? <table cellpadding="0" cellspacing="0" border="0"> <tr>
9
37011
by: Ken | last post by:
I am trying to create one image using JavaScript; then later in the script remove the image - not just remove the src. The following creates the image, but I have been unable to remove it. How do I structure document.getElementById('num1').removeChild(image_display); ? <input type=file name="picture1" onChange="image(this.value, 'num1');" Id="pt1"> <div id='num1'></div>
10
4723
by: Rock | last post by:
Hi, I want to create this.. A 2 col table with 3 rows down. In the 1st col I want three thumb size images, 1 in each row When an image is rolled on, the larger image shows up in col 2
3
1806
by: wolfing1 | last post by:
how would I go doing it without javascript and using 'POST'? Having a page with a variable list of items in a shopcart, each item with its own 'remove' button. How could I do this without a javascript and using POST as the form type? (so having <a href="page.htm?remove=2> is not possible)
2
2102
by: Gozil | last post by:
Hello, im having a problem with the text input field im working with. I've made an ajax application that will suggest different links below the input field but if the user already searched something before it will appear a suggest box with previous searches from that user... Look at the picture below and you'll understand what im talking about. http://img338.imageshack.us/img338/4500/preboxvk7.gif I have seen sites that never get that...
9
2157
by: Summercool | last post by:
I wonder to show the images in a table format... and to set a box of width 100px and height 100px, is there a way? Right now, if I set width to 100px, then height can be 180px... If I set height to 100px, then width can be 260px... What I really want is, to have the greatest width and greatest height so long as none of them exceed 100px, and maintaining the aspect ratio. (I don't want to set both width and height to 100px for the
11
3320
by: David | last post by:
Hi All, I am working on a script that is theoreticaly simple but I can not get it to work completely. I am dealing with a page spit out by .NET that leaves empty tags in the markup. I need a javascript solution to go behind and do a clean up after the page loads. The .NET will leave behind any combination of nested tags. Here is an example below. Even though the <spantags are not empty, as they contain <emtags they also need to be...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.