Monday, July 26, 2010

Apply CSS to create Image Border




Please visit my new Web Site WWW.Codedisplay.com



Sometimes Asp.net developers need to enhance the UI by using image border. Though it's a bit easy in Asp.net image controls by using SKIN to manage image borders but it will be a bit difficult to manage HTML image control without CSS. Here in this post i will show you how one can apply CSS in both Asp.net image control and HTML image control. To do that first write the below CSS:











<style type="text/css">
    .imageCSS
 {
    padding: 3px;
    background-color: #FF0000;
 }
    </style>

Asp.Net Image Control:
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Image ID="Image1" runat="server" CssClass="imageCSS" ImageUrl="images/blue_flower.jpg" />
    </div>
    </form>
</body>

HTML Image Control:
<body>
    <form id="form1" runat="server">
    <div>
        <img src="~/Images/blue_flower.jpg" id="Image2" class="imageCSS" runat="server" />
    </div>
    </form>
</body>

Hope it will help.

0 comments:

Want to say something?
I WOULD BE DELIGHTED TO HEAR FROM YOU

Want To Search More?
Google Search on Internet
Subscribe RSS Subscribe RSS
Article Categories
  • Asp.net
  • Gridview
  • Javascript
  • AJAX
  • Sql server
  • XML
  • CSS
  • Free Web Site Templates
  • Free Desktop Wallpapers
  • TopOfBlogs
     
    Free ASP.NET articles,C#.NET,VB.NET tutorials and Examples,Ajax,SQL Server,Javascript,Jquery,XML,GridView Articles and code examples -- by Shawpnendu Bikash