473,799 Members | 2,693 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
21 6524
John Hosking <Jo**@DELETE.Ho sking.name.INVA LIDwrote:

[good advice snipped]
>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.
Consecutive line break tags are always a bad idea, but there are
occasions where a single line brake tag is appropriate.
>First of all, they are not XHTML
either: you need to close all elements, here with <br/>.
Indeed, although when the document is served as text/html as the OP is
allegedly doing the advice in appendix C should be followed by inserting
a space: <br />.
>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; }
There should only be one instance of a given id per document, class
would be the thing to use for such an occasion. It should also be noted
that since CSS should be considered 100% optional, the functionality
(preventing unnecessary reflows) offered by providing the dimensions
means that usually the dimension should preferably be specified in the
markup.
>I believe &nbsp; is not valid XHTML. Check the W3C docs.
Perfectly valid, but indeed much abused.

--
Spartanicus
Jan 14 '07 #11
Spartanicus wrote:
John Hosking <Jo**@DELETE.Ho sking.name.INVA LIDwrote:
>... get rid of the extra <brtags everywhere.

Consecutive line break tags are always a bad idea, but there are
occasions where a single line brake tag is appropriate.
A good expansion of what I meant when I said "extra". The vast majority
of the <br>s in the source were in strings of three or more (up to
*five*). A couple of single instances were used as padding in an <h2>
element. Only one single-instance <brthere really qualified as
appropriate, IMO.
>
>>First of all, they are not XHTML
either: you need to close all elements, here with <br/>.

Indeed, although when the document is served as text/html as the OP is
allegedly doing the advice in appendix C should be followed by inserting
a space: <br />.
Yes, right.
>
>>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; }

There should only be one instance of a given id per document, class
would be the thing to use for such an occasion.
The rule you mention is right, but I saw that his images are several
different sizes. I didn't want to mention a class, because then he'd be
confused. ;-) I should maybe have said, "On each of your uniquely-sized
images, apply an id, for all of the common-sized images, a class..."
It should also be noted
that since CSS should be considered 100% optional, the functionality
(preventing unnecessary reflows) offered by providing the dimensions
means that usually the dimension should preferably be specified in the
markup.
Yes, this *should* be noted. It's a problem. Although for this
particular page, there wouldn't be that much reflowing, would there? Or
would that wreak havoc anyway with screen readers?

--
John
Jan 15 '07 #12

Russell Hoover wrote:
I reverted to border="0" inside the "img" tag. This of course does not validate as xhtml.
It would validate fine as XHTML. It's invalid because it's under a
Strict doctype, whether that's XHTML or HTML. It would still be valid
under XHTML Transitional.
First of all, use HTML. rather than XHTML. XHTML gains you nothing.
It's also harder to use correctly.

You're not using XHTML anyway, you're using Appendix C XHTML instead --
authoring it as XHTML and then sending it out as HTML, where it's
treated by the browsers as broken but auto-fixable HTML. This is better
than using "pure" XHTML, which just fails to work completely for a
significant number of browsers. However you're making life hard for
yourself, compared to HTML.

In particular, lose the following
<?xml version="1.0" encoding="utf-8"?>

and
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

I'd also note that the markup itself is bogus (valid, but badly
structured). If your code is still using repeated
<br /><br /to control layout, then the site _really_ isn't in a state
to benefit from XHTML.
To return to your stated question, you have a couple of options
regarding the "border" issue:

- Drop back to a Transitional doctype and keep "border" as an
attribute. This is a pragmatic fix to make your page valid for least
effort. If that's all you need, then do just this.

- Switch to controlling your borders through CSS. This is a better
approach for any long-term maintenance of the page. You'll probably use
a selector and rule a bit like this:
a img { border: none; }

You might find it useful to use a class attribute too, if you only
wanted this behaviour in a few places, not for every linked image.

Jan 15 '07 #13
On 15 Jan 2007 03:32:54 -0800, Andy Dingley <di*****@codesm iths.comwrote:
>
It would validate fine as XHTML. It's invalid because it's under a
Strict doctype, whether that's XHTML or HTML. It would still be valid
under XHTML Transitional.

Thanks to all who commented. Clearly I have a number of fundamental issues
to resolve. I'm 50 pages into the O'Reilly CSS guide and my site is on
hold til I get a better grasp of how to proceed.
Jan 17 '07 #14

Russell Hoover wrote:
I'm 50 pages into the O'Reilly CSS guide and my site is on
hold til I get a better grasp of how to proceed.
I'm not sure the O'Reilly will help! There's a shortage of good HTML
/ CSS tutorials that teach _good_ style, as opposed to merely
annotating the spec. O'Reilly's (animal engraving covers) aren't one of
them. However their "Head First HTML & CSS" is a good one and I'd
strongly recommend it.

This stuff isn't hard to teach or to understand, but most people just
come into it from the wrong direction, read the wrong book and then
find themselves knowing details but not the big picture. Then they show
up here and wonder why their sites get shredded.

Jan 17 '07 #15

Andy Dingley skrev:
Russell Hoover wrote:
I'm 50 pages into the O'Reilly CSS guide and my site is on
hold til I get a better grasp of how to proceed.

I'm not sure the O'Reilly will help! There's a shortage of good HTML
/ CSS tutorials that teach _good_ style, as opposed to merely
annotating the spec. O'Reilly's (animal engraving covers) aren't one of
them. However their "Head First HTML & CSS" is a good one and I'd
strongly recommend it.

This stuff isn't hard to teach or to understand, but most people just
come into it from the wrong direction, read the wrong book and then
find themselves knowing details but not the big picture. Then they show
up here and wonder why their sites get shredded.
Did you mean "Head First HTML with CSS & XHTML"?

Jan 17 '07 #16

Roy A. wrote:
Did you mean "Head First HTML with CSS & XHTML"?
That's the one. It's particularly good on how it treats XHTML. It
mentions it (because people buying books look for it) and then tells
you exactly why you shouldn't be using it.

Jan 17 '07 #17

Andy Dingley skrev:
Roy A. wrote:
Did you mean "Head First HTML with CSS & XHTML"?

That's the one. It's particularly good on how it treats XHTML. It
mentions it (because people buying books look for it) and then tells
you exactly why you shouldn't be using it.
And why shouln't you be using XHTML? If served properly, it should be
okey.

Jan 17 '07 #18

Roy A. wrote:
And why shouln't you be using XHTML? If served properly, it should be
okey.
Because it fills newsgroup archives with stuff that you clearly didn't
bother searching for before.

Jan 17 '07 #19

Andy Dingley skrev:
I'm 50 pages into the O'Reilly CSS guide and my site is on
hold til I get a better grasp of how to proceed.

I'm not sure the O'Reilly will help! There's a shortage of good HTML
/ CSS tutorials that teach _good_ style, as opposed to merely
annotating the spec. O'Reilly's (animal engraving covers) aren't one of
them. However their "Head First HTML & CSS" is a good one and I'd
strongly recommend it.
If you are using HTML 4.01 and want to validate your document, you may
want something before the head element. "Head First HTML & CSS" may be
a good book (I say "may" because av haven't read it), but I wouldn't
throw away my other books. O'Reilly has many good books, with or
without animals on the front cover. And I would think other publishers
also could offer some help.

Jan 18 '07 #20

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
4725
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
2103
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
3322
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
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10495
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10248
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
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7573
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
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
5469
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...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2942
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.