C
C#ā€¢4w 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ā€¢4w ago
What does it look like in dev tools? Both the html element and the CSS file?
MooCalf
MooCalfOPā€¢4w ago
Dev tools?
greyfox
greyfoxā€¢4w ago
Open browser, right click, inspect element; or hit f12
MooCalf
MooCalfOPā€¢4w ago
this?
No description
greyfox
greyfoxā€¢4w ago
That's part of it. Pop out the dev tools. Look in the elements tab, and the sources tab.
MooCalf
MooCalfOPā€¢4w ago
uhhh, yeah im not 100% if im even doing it right šŸ˜…
No description
greyfox
greyfoxā€¢4w 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ā€¢4w 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ā€¢4w ago
It's called "undock", sorry Just use the mouse and wait for the tooltip
MooCalf
MooCalfOPā€¢4w ago
oh! i found it
MooCalf
MooCalfOPā€¢4w ago
No description
greyfox
greyfoxā€¢4w 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ā€¢4w ago
:blobnod: thank you! ive noticed however, the div style elements i applied isnt showing up
greyfox
greyfoxā€¢4w ago
You can use the console to run JavaScript functions or examine the contents of vars.
MooCalf
MooCalfOPā€¢4w ago
No description
greyfox
greyfoxā€¢4w 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ā€¢4w 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ā€¢4w ago
added it and now it works
No description
MooCalf
MooCalfOPā€¢4w ago
but why wouldnt it work in VS?
greyfox
greyfoxā€¢4w ago
May have been cached. Do a hard refresh in the browser.
MooCalf
MooCalfOPā€¢4w 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
Want results from more Discord servers?
Add your server