Wednesday 24 April 2013

CSS - Simple example how to add style sheet to web form


Watch this example on YouTube:



Inline example:
Copy code below 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication19.WebForm2" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        h1 {
            font-size: 30px;
            color: red;
        }
        p {
            color:blue;
            font-style: italic;
        }
        .RightAlign {
            text-align: right;
        }
         div
        {
            width:100px;
            padding:50px;
            border:5px solid black;
            margin: 1px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <p> this is normal text</p>
        <p class="RightAlign">This is right aligned text</p>
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment