I'm trying to understand and manipulate the content/settings in Site.css without ANY success.
For example, if I change the background-color to #e80c4d (red) in
Its because you have a starter site and in starter site there are other divs too.
For example the text you see on main page is in div with class main-content
If you want to change the background-color for that you need to scroll down to mid point there will be class for main-content (Or the class of the div) then edit that background-color.
Note: While editing the page css please note that you need to use class, ids for your elements. This will help you edit the style for every element without changing the style of others.
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
@{Layout="~/_SiteLayout.cshtml";Page.Title="Home Page";}@section featured {<sectionclass="featured"><divclass="content-wrapper"><hgroupclass="title"><h1>@Page.Title.</h1><h2>Modify this template to jump-start your ASP.NET Web Pages application.</h2></hgroup><p>
To learn more about ASP.NET Web Pages, visit
<ahref="http://asp.net/webpages"title="ASP.NET Web Pages Website">http://asp.net/webpages</a>.
The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET Web Pages.
If you have any questions about ASP.NET Web Pages, visit
<ahref="http://forums.iis.net/1166.aspx"title="ASP.NET Web Pages Forum">our forums</a>.
</p></div></section>}<h3>We suggest the following:</h3><olclass="round"><liclass="one"><h5>Getting Started</h5>
ASP.NET Web Pages and the new Razor syntax provide a fast, approachable, and lightweight way to combine server code with HTML
to create dynamic web content. Connect to databases, add video, link to social networking sites, and include many more features
that let you create beautiful sites using the latest web standards.
<ahref="http://go.microsoft.com/fwlink/?LinkId=245139">Learn more…</a></li><liclass="two"><h5>Add NuGet packages and jump start your coding</h5>
NuGet makes it easy to install and update free libraries and tools.
<ahref="http://go.microsoft.com/fwlink/?LinkId=245140">Learn more…</a></li><liclass="three"><h5>Find Web Hosting</h5>
You can easily find a web hosting company that offers the right mix of features and price for your applications.
<ahref="http://go.microsoft.com/fwlink/?LinkId=245143">Learn more…</a></li></ol>
longemaja
Member
1 Points
13 Posts
Starter Site's Site.css
Nov 07, 2012 08:05 AM|LINK
I'm trying to understand and manipulate the content/settings in Site.css without ANY success.
For example, if I change the background-color to #e80c4d (red) in
nothing happens. Is there any blog or other media where the Starter Site's Site.css is explained?
h.zahed@live...
Contributor
3171 Points
514 Posts
Re: Starter Site's Site.css
Nov 07, 2012 08:28 AM|LINK
Hi,
Is the css file connected to your master page file in head section?
MCP-MCTS-MCPD
Mark the post as Answer, if it helped you in solving your question.
longemaja
Member
1 Points
13 Posts
Re: Starter Site's Site.css
Nov 07, 2012 08:33 AM|LINK
The path (generated by the Starter Site Template in Webmatrix 2) is
~/Content/Site.css
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Starter Site's Site.css
Nov 07, 2012 10:26 AM|LINK
The problem is not this.
Its because you have a starter site and in starter site there are other divs too.
For example the text you see on main page is in div with class main-content
If you want to change the background-color for that you need to scroll down to mid point there will be class for main-content (Or the class of the div) then edit that background-color.
Note: While editing the page css please note that you need to use class, ids for your elements. This will help you edit the style for every element without changing the style of others.
~~! FIREWALL !~~
longemaja
Member
1 Points
13 Posts
Re: Starter Site's Site.css
Nov 07, 2012 11:47 AM|LINK
Nothing happens if I add background-color in class main-content. Please have a look at the Site.css below;
raju dasa
Star
14412 Points
2452 Posts
Re: Starter Site's Site.css
Nov 07, 2012 12:36 PM|LINK
Hi,
try clearing ur browser cache, then run it again.
to manipulate CSS on the fly, u can use the browser tools:
>Developer tools (IE9) by pressing F12
>Firebug plugin for Firefox browser
rajudasa.blogspot.com || blog@opera
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Starter Site's Site.css
Nov 07, 2012 07:29 PM|LINK
Ok this was the css.
Did you change the divs ??
Please provide me with the main page code (Default.cshtml)
In that page the divs with classes would be given. From there I would see what class you want to change the color for
~~! FIREWALL !~~
longemaja
Member
1 Points
13 Posts
Re: Starter Site's Site.css
Nov 07, 2012 07:33 PM|LINK
Here is the Default.cshtml:
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Starter Site's Site.css
Nov 07, 2012 07:46 PM|LINK
Ok let me elaborate you the code.
If you see your code.
There is no body div or class. But body is a main element of page. So your code will gain this background.
Now next line
For this there will be
.featured { code will b here for style }than next is a div for that you see its class is content-wrapper for this will see a code as
.content-wrapper { code here.. }than there are paragraphs(p) and some headings (h1, h2) for these you can use this
h1 { code.. } h2 { code.. } p { code.. }as you can see in your site.css page in the start.
But I will ask you to learn the html basics from this website : https://www.w3schools.com
I hope this helps you. If does please mark my posts as answers thankyou!
~~! FIREWALL !~~