C
C#•5mo ago
MooCalf

CSS wont apply to the code

For some reason why i try to add a CSS style to a specific section of my ASP.NET code, it does seem to work at all? Yes, i do have the stylesheet connect and i know it is because its working on other parts of the code EXCEPT new changes i am making right now. Ive tried removing and adding back older codes where it does work and they apply just fine but for this part like shown in the image, it doesnt. I am testing this by adding a background color to the 'div' tag and making it red as well as making the color of the text red but as shown, nothing happens and they text is simply black and no background color even appears
No description
No description
21 Replies
greyfox
greyfox•5mo ago
What does it look like in dev tools? Both the html element and the CSS file?
MooCalf
MooCalfOP•5mo ago
Dev tools?
greyfox
greyfox•5mo ago
Open browser, right click, inspect element; or hit f12
MooCalf
MooCalfOP•5mo ago
this?
No description
greyfox
greyfox•5mo ago
That's part of it. Pop out the dev tools. Look in the elements tab, and the sources tab.
MooCalf
MooCalfOP•5mo ago
uhhh, yeah im not 100% if im even doing it right šŸ˜…
No description
greyfox
greyfox•5mo ago
You're not, but you're learning. Look in the menu ribbon of the dev tools. On the left hand side, there should be a "pop out" button Click it. Do all your client side testing here in dev tools.
MooCalf
MooCalfOP•5mo ago
do you by chance know what the icon of the pop-out button looks like? I dont think i am seeing it at all
greyfox
greyfox•5mo ago
It's called "undock", sorry Just use the mouse and wait for the tooltip
MooCalf
MooCalfOP•5mo ago
oh! i found it
MooCalf
MooCalfOP•5mo ago
No description
greyfox
greyfox•5mo ago
Usually a good idea to have the browser and tools open side by side on different windows so you can see changes in real time.
MooCalf
MooCalfOP•5mo ago
:blobnod: thank you! ive noticed however, the div style elements i applied isnt showing up
greyfox
greyfox•5mo ago
You can use the console to run JavaScript functions or examine the contents of vars.
MooCalf
MooCalfOP•5mo ago
No description
greyfox
greyfox•5mo ago
Yeah open the stylesheet in sources tab. And look at your specific css selector Likewise look at the element tabs and see what the html looks like
MooCalf
MooCalfOP•5mo ago
:thinkingPonderingPikachu: finding all these tabs seems a bit difficult, not sure where they are found them, my bad šŸ˜… yep, the .recommendation didnt even appear
MooCalf
MooCalfOP•5mo ago
added it and now it works
No description
MooCalf
MooCalfOP•5mo ago
but why wouldnt it work in VS?
greyfox
greyfox•5mo ago
May have been cached. Do a hard refresh in the browser.
MooCalf
MooCalfOP•5mo ago
turns out it something to do with read-only files. the entire project seems to be a read-only file im sending it thru github between a few of my class mates for a project so im not sure if thats the issue

Did you find this page helpful?