-
Mar 23rd, 2013, 04:07 AM
#1
Thread Starter
Hyperactive Member
HTML5 CSS not applying
I'm using the following in ASP.net to display an Image, as well css. But when I view the source, it doesn't apply the CSS to the image. I've ran the W3C validator, and keeps telling that the Border attribute is obsolete:
The border attribute is obsolete. Consider specifying img { border: 0; } in CSS instead.
<img id="ctl00_topmenu" src="_images/menutop1.jpg" alt="topmenu" border="0" />
Linking to my CSS
Code:
<link href="_css/style.css" rel="stylesheet" type="text/css" />
Specifying my image
Code:
<asp:Image ID="topmenu" CssClass="topimg" runat="server" ImageUrl="~/_images/menutop1.jpg" AlternateText="topmenu"/>
CSS:
Code:
.topimg
{
vertical-align:top;
padding:0px;
border-width:1px;
}
And then this is what is displayed in the source of the site :
Code:
<img id="ctl00_topmenu" class="topimg" src="_images/menutop1.jpg" alt="topmenu" style="border-width:0px;" />
Any idea what am I doing wrong? Just let me know if I need to provide more code..
Thanks
-
Mar 23rd, 2013, 04:42 AM
#2
Thread Starter
Hyperactive Member
Re: HTML5 CSS not applying
Another thing, even tho I remove the css completely, and also don't specify a border at all, whether in css or on the image self, I still get the border is obsolete error in W3C? And the source still displays this no matter what I do.
Code:
<img id="ctl00_topmenu" class="topimg" src="_images/menutop1.jpg" alt="topmenu" style="border-width:0px;" />
Have no idea how to get rid of the error, which is my ultimate goal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|