HTML5 CSS not applying-VBForums
Results 1 to 2 of 2

Thread: HTML5 CSS not applying

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    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

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Posts
    307

    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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.