W3C validation there is no attribute "border" on imagebuttons.

Posted on 2008-10-24
Last Modified: 2013-11-19
Ok, I really need help, I've been banging my head against the wall over this for hours.
I can't get my pages to validate.
here's 2 samples:
both say that there is no attribute "border".
although during run time on my web server there seems to be a "border" attribute popping up for these 2 image buttons, I assure you there is no such attribute set in my code. I've even deleted all the stylesheets to make sure they weren't interferring. I have no idea where this border attribute is or why it's popping in, can somebody please help? I've been working on this for 4 hours now :( Thanks, Chris.
Question by:jumpstart0321
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
LVL 44

Expert Comment

ID: 22801095
Actually, you can solve the problem by specifying a border --

Button.image  { padding:0px; margin:0px; border:0px }

If you give your button the class of "image", this should remove the errors.  yes?  no?

On another point -- you can't be serious about using that page background for that site, can you?  I mean it makes the whole page text unreadable.  Not trying to be critical, but it is going to alienate almost everyone.  I assume this is just for testing?   Whatever you do, get the background image to where it doesn't kill the text.

Author Comment

ID: 22801912
Still a no go. Ok, here is what I've put in:
<style type="text/css">
        button.image  { padding:0px; margin:0px; border:0px }
<asp:ImageButton ID="btnSearchItem" runat="server" ImageUrl="~/images/search_btn.jpg" class="image"/>
As far as the background. I just read a marketing article on branding and I guess I took it a little overboard. I've taken the opacity down 50%. It looks a lot better now. Any more ideas?

Author Comment

ID: 22801946
One other thing I might mention that's odd. If I view it live in my home browser, then copy and paste the source into w3c, it validates. But, when posting it to my live server, the source does not validate. I've included the validation on the home page so all you have to do is click on it. The icon is in the top right hand corner.
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users


Author Comment

ID: 22802033
Ok, well this is odd. Apparently you can copy and paste the source code from the pages into w3c directly and it validates. So, why would they're direct URL validation tool not validate?
LVL 39

Accepted Solution

Roger Baklund earned 500 total points
ID: 22802696
There seems to be some server side browser sniffing going on... I get a different source when I telnet to fetch your page (no useragent header).

This is what firefox sees:

<input type="image"
  style="border-width:0px;" />

... and this is what I see with telnet, apparently the same as the validator sees:

<input type="image"
  border="0" />

Author Comment

ID: 22803887
Ok, I've taken your advice and tried about every single solution I can think of including reverting my web.config file back to the bare bones, and disabling my URL rewrite sofware. Still nothing. Ouch, 24 hour of banging my head and still nothing.
LVL 44

Expert Comment

ID: 22804490
why go through all that hassle because of "validation" ?  What validates or not depends on the DOCTYPE in the head.  try a different one, like --

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

instead of this --

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

If it's just for one "border" comment, forget it.  Probably 90% of pages on the net don't validate perfectly, according to some standard or other -- all of which are moving targets anyway, and will all change.

Author Comment

ID: 22862764
SEO man, these days it means a lot when it comes to traffic. People may say it means nothing, but I have seen firsthand the difference between messy sites and cleaned up sites and it is huge. I found the solution as listed here:
cxr was able to target the problem, but not the solution. A good shot anyways though; this was difficult to fix.

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
If you don’t want your company's site to fail on the web, you’d do well to observe these best web design practices and make sure you implement them when applicable.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question