problem with style sheet on Asp net

Asked

Viewed 191 times

0

I use visual studio 2012. I’m working with Asp net. I have a style sheet inside a folder and reference it on an aspx page. When I create a new html tag, a <h3> for example, and I make simple modifications to the style sheet as the element color, sometimes it happens that this modification is not applied, ie the <h3> is the default color. However, if I put the <style></style> and the modifications in aspx itself are applied. It does not matter if it is by class or by id, this is sometimes happening. To solve this, I can also copy the content of the style sheet that is no longer working and paste it into a new style sheet. Weird, right? This is happening often, because it will be?

Note: I updated the page and even opened another, but the problem persisted, only solved as I said above.

2 answers

3


It’s probably the browser cache. When it happens reload to page using Ctrl+R.

When you access a page, the browser saves the files in memory to load faster later. So when you reload the page it takes the files from memory instead of taking what you edited.

  • But I updated the page and nothing happened and even opened another by VS, persisted the problem.

  • Do you update with 'Ctrl + R' / 'Ctrl + shift + R' or normal F5? Because when you update normal, with F5 or by the button in the browser bar, the cache is not clean. The commands I placed reload and clear the page cache.

  • Ok, I would reload with the same F5. When the problem happens I will do as I said.

  • The problem happened again, and really with "Ctrl + shift + r" solved. Thank you, beast!

0

Complementing Rafael’s responses, check that the css file is set correctly, for example:

<head>
<title>Exemplo</title>
<link href="custom.css" rel="stylesheet" />
</head>

Another question is whether there is another classe or Id element of own CSS or another, is not interfering with the property you want to change or set. It is worth remembering, that you can give greater importance to property, as follows:

.teste {background-color:#808080 !important;}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.