今天总结一下学习asp.net
- 建一个空网站,然后先引入 Modernizr,在引入 jQuery
- 然后添加主题,规划母版页面
- 下面一段就是一个标准的母版页
- 在本母版也,用来规划页面的页头,菜单位置,页面内容位置,还有页脚位置。
<div id="PageWrapper"> <header> 页眉栏 </header> <nav> 菜单栏 </nav> <section id="MainContent"> <asp:ContentPlaceHolder ID="cpMainContent" runat="server"> </asp:ContentPlaceHolder> </section> <aside id=“AsideBar”> Aside bar goes here </aside> <footer> Footer Goes Here </footer> </div>
- 主题:
*
#PageWrapper
{
width: 844px;
background-color: #5487c0;
margin: auto;
}
header
{
background-image: url(Images/Header.jpg);
width: 844px;
height: 86px;
}
nav
{
background-image: url(Images/MenuBackground.jpg);
width: 827px;
height: 36px;
padding-top: 7px;
padding-left: 17px;
}
.MainMenu
{
/*
The Menu gets a white border on all four sides.
*/
border: 1px solid #999999;
width: 814px;
height: 19px;
background-color: #555555;
}
.MainMenu ul li
{
/*
Gives the four menu items in the main menu a width of 200px each.
*/
width: 200px;
}
section#MainContent
{
/*
Defines the main content area. The #MainContent element has a minimum height of 500 pixels, but can grow if necessary.
The font-size is 80% of its parent element, which in this case comes down to 80% of the font
the user has specified as the default font in the browser.
*/
font-size: 0.8em;
width: 659px;
border-left: 1px solid white;
border-right: 2px solid white;
float: left;
background-color: #e1e1e1;
min-height: 500px;
padding: 10px;
}
aside#Sidebar
{
/*
The Sidebar is positioned to the right of the MainContent section. It gets the same font-size as the
#MainContent section and gets a background image called Sidebar.jpg.
To ensure the image is visible in (most) browsers on a small page, the element gets a minimum
height of 500px. This is ignored by IE 6.
*/
font-size: 0.8em;
color: White;
background-image: url(Images/Sidebar.jpg);
background-repeat: no-repeat;
background-color: #7773A1;
width: 142px;
min-height: 500px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
float: left;
}
footer
{
/*
The footer is positioned below all other content (yet still within PageWrapper).
clear: both is used to clear the impact of the float properties used for #MainContent and #Sidebar.
*/
width: 844px;
clear: both;
height: 37px;
background-color: #A8D5FE;
color: White;
text-align: center;
font-size: 0.7em;
font-weight: bold;
line-height: 37px;
}
`