4:05 AM

Create simple dropdown CSS menu in asp.net

Posted by vijay


In a previous article i explain about to create asp.net menu control with CSS, Here we build the dropdown menu with simple CSS.

Some project there no use create with asp.net menu control. In that case we can use the simple CSS menu.
Main purpose of the article to explain the creation of simple CSS menu, i hope this one will be easy to understand the concept behind on CSS menu, here am not using any JavaScript to create CSS





CSS:
<style type="text/css">
        ul
        {
            padding: 0px;
            margin: 0px; /*By default padding and margin set as zero*/
        }
        /*www.Dotnetcode.in*/
        ul li
        {
            display: inline; /*IT change ul display  in single line*/
            float: left; /*www.Dotnetcode.in*/
            width: 100px; /*Every menu its set the width*/
            font-size: 15px; /*Set the font size*/
            font-family: @Arial Unicode MS Verdana;
            vertical-align: middle;
        }
        ul li a
        {
            color: #FFFFFF;
            display: block;
            background-color: #C82B16;
            text-decoration: none;
            line-height: 30px; /*Increase menu height*/
            padding-left: 8px;
        }
        ul li a:hover
        {
            /*www.Dotnetcode.in*/
            background-color: #333333; /*when doing Hover the color bg color change*/
        }
        ul li ul li a
        {
            background-color: #C82B16;
            font-size: 12px;
        }
        ul li ul li a:hover
        {
            background-color: #333333;
            height: 30;
            font-size: 12px;
        }
        ul li ul
        {
            visibility: hidden; /*Intial sub mune is hidden*/
        }
        ul li:hover ul
        {
            visibility: visible; /*when doing Hover submenu visible*/
        }
    </style>

The list code make as menu control
<table cellpadding="0" cellspacing="0">
        <tr>
            <td>
                <!--www.Dotnetcode.in-->
                <ul>
                    <li><a href="Home.aspx">Home</a></li>
                    <li><a href="Menu.aspx">Menu1</a></li>
                    <li><a href="Menu2.aspx">Menu2</a>
                        <ul>
                            <li><a href="SubMenu1.aspx">SubMenu1</a></li>
                            <li><a href="SubMenu2.aspx">SubMenu2</a></li>
                            <li><a href="SubMenu3.aspx">SubMenu3</a></li>
                        </ul>
                    </li>
                    <li><a href="Menu3.aspx">Menu3</a></li>
                </ul>
                <!--www.Dotnetcode.in-->
            </td>
        </tr>
    </table>

I hope you it helpful and you like it
Share it with your friends


Inline style:
Inline styles are CSS styles that are applied to one element using the style attribute. This style are applied only for this particular paragraph, this styles did not affect remaining content.
ex:
<p style="background:#ccc; color:#fff; border: solid black 1px;">

Apply style directly to the element..

Cascading Style Sheets:
By declaring cascading style its gives the consistency look to your page. For an example, In your page, if you are using H4 element in many places.so Here you simply declare that all H4 headlines are blue color. Put the following code in the <head> of your HTML. All the h4 tag content are display in blue color.
ex:
<style type="text/css">
 h4 { color: #0000ff; }
 </style>


Embedded style sheet:
By applying embeded style look your page become more standard. Its easy way to handle the css in separate file with the extension .css. Once you created such file, then you can easily link the file with your page.so general page contains only html tag.
This you can save separately css file and link the file to the code..
Ex:
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css" />
</head>

10:44 PM

Rounded corner Textbox in asp.net

Posted by vijay


HI..Friends..Now I am going to share to create a round corner textbox in asp.net..Suppose if you want to design your site with more attraction then you can create this type of style using css..
Its very simple to apply css for textbox..
Write the below code css for text box..
<style type=”text/css”>
</style>
.txtbox
{
     
     border-top-left-radius: 20px;

border-top-right-radius: 20px;

border-bottom-left-radius: 20px;

border-bottom-right-radius: 20px;
}
</style>


  <asp:TextBox ID="TextBox1" runat="server" cssclass=”txtbox”></asp:TextBox>

Then your textbox looks like below………

I hope this one helpful to some one..
Share your thought here…..

5:33 AM

Apply Gradient color using CSS

Posted by vijay


HI..In this article I would like to share about apply gradient color using css.I hope this one really interested to use gradient color…So many of them like to make the website with more colorful..
But you can achieve that using css3..
Already I have written about related to CSS article..for your reference I give link below……..
Normally gradient color apply  to div or table..so you can use the css for table or div…
Copy and paste the below code in your page then apply css to your table..


.css-grd {
/* default background colour, for all layout engines that don't implement gradients */
background: #E7EDD1;

/* gecko based browsers */
background: -moz-linear-gradient(top, #E7EDD1, #FDFDFD);

/* webkit based browsers */
background: -webkit-gradient(linear, left top, left bottom, from(#E7EDD1), to(#FDFDFD));

color: #000000; /* text colour (black) */
height: auto; /* gradient uses the full height of the element */
padding: 5px; /* distance from border edge to text */
}

But an unfortunately gradient css works only on Mozila and chrome and latest version ie9 it will not support ie7 or ie 8