Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8650421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:49:04+00:00 2026-06-12T13:49:04+00:00

I have some css, which when inside my CSS file isn’t applied to my

  • 0

I have some css, which when inside my CSS file isn’t applied to my designer in Visual Studio, but is applied to the page when I publish it. This issue is slowing down site development massively as I’m trying to pick up CSS as I go…

Here’s a sample bit of CSS:

.header {
    background-color: #ccc;
    border-bottom: 1px solid #666;
    color: #222;
    display: block;
    font-size: 20px;
    font-weight: bold;
    padding: 100px 100px 100px 100px;
    text-align: center;
    text-decoration: none;
        text-shadow: 0px 1px 0px #fff;
    background-image: -webkit-gradient(linear, left top, left bottom, 
                                       from(#ccc), to(#999));
}

Me applying the CSS on the page:

<header>
    <asp:Label ID="lblQuestion" runat="server" Font-Bold="True" Font-Size="16pt" Text="Your question goes here..." CssClass="header"></asp:Label>
</header>

Me adding the CSS to the page:

<link rel="stylesheet" type="text/css" href="mycss.css" media="only screen and (max-width: 480px)" />

I’m pretty new to CSS, so I’m hoping someone can tell me what I’m doing that is stopping Visual Studio rendering the CSS properly in the designer…

Also, if I put my CSS tags directly in the page then it works, but I’d much rather keep my CSS out in it’s own file, where it can be reused.

Example style working:

<style>
    .header {
        background-color: #ccc;
        border-bottom: 1px solid #666;
        color: #222;
        display: block;
        font-size: 20px;
        font-weight: bold;
        padding: 100px 100px 100px 100px;
        text-align: center;
        text-decoration: none;
        text-shadow: 0px 1px 0px #fff;
        background-image: -webkit-gradient(linear, left top, left bottom, from(#ccc), to(#999));
    }
</style>

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:49:05+00:00Added an answer on June 12, 2026 at 1:49 pm

    I suggest taking a look at Jeff Widmer’s blog post, Why does Visual Studio not resolve my CSS class names?

    Basically, site relative path’s aren’t supported by Visual Studio. It is the same reason why intellisense doesn’t work for javascript.

    He offers a fix for this issue:

    <link href="/content/default.css" rel="stylesheet" type="text/css" />
        <% if (false) {%>
            <link href="../../content/default.css" rel="stylesheet" type="text/css" />
        <% } %>
    

    UPDATE:

    The problem here was the media element in the link tag for the css. It doesn’t appear that VS knows what that tag is and thus doesn’t try to resolve the url.

    In this case, the css file is in the same folder as the page, so it would work. But, if the css file is moved into another folder, then it would stop working and the fix above would solve the issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CSS file, which contain the style information of my web. Some
I have this code: <body onLoad=subcatSelection();> The function is inside a .js file which
I have some CSS theming which I would like to do to the head
I have a fairly large page, which contains lots of css and html. The
Which one gets applied at the end? CSS from external file inline CSS I
I have a complex long XHTML file, which contains CSS. Searching on google and
I have a page news.html which is php included in my index.html - inside
I have a css file and inside it I have url('PTN77F-webfont.eot') - for font
I have some CSS and HTML for horizontal tabs that works perfectly in jsfiddle.
I have some CSS that doesn't behave correctly with IE8. It works fine with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.