Learn ASP.NET Web Pages by building a web site from scratch.
Part II: Adding CSS and a Standard Layout.
In this chapter we will:
In your web folder (DemoWebPages), create a new CSS file named "Site.css".
Put the following code inside the CSS file:
The CSS file above defines the styles to be used used for
In your web folder (DemoWebPages), create a new CSHTML file named "Layout.cshtml".
Put the following code inside the layout file:
The layout file above defines the layout of your web pages. It has a link to your style sheet file (Site.css), and a call to the @RenderBody() function, where your page content should be displayed.
In your "DemoWebPages" folder, edit the file named "Default.cshtml".
Change the content to the following:
The file starts with a reference to the layout file, otherwise it contains normal HTML markup.
You have created your first web site, with a main page (Default.cshtml), a common template for all your pages (Layout.cshtml), and a common style sheet (Sire.css).
In the next chapters of this tutorial, we will add a database to the web site. Then we will add login and security, and finally add navigation.
The perfect solution for professionals who need to balance work, family, and career building.
More than 10 000 certificates already issued!
The HTML Certificate documents your knowledge of HTML.
The HTML5 Certificate documents your knowledge of advanced HTML5.
The CSS Certificate documents your knowledge of advanced CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The jQuery Certificate documents your knowledge of jQuery.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
Your message has been sent to W3Schools.