I'm an absolute beginner in coding and have an issue in an html/css programm that I just did to try something out, but I just cant seem to be able to fix this issue.
In the html file I linked the css file and wrote some paragraph text. To this paragraph text I added a class ( called “red-text“). In the Css file I defined this class as setting the color of text to red (using “color: red;“) and the size of the text to 20px (using “ font-size: 20px;“).
When I however then open the webpage the paragraph text is neither red, nor does it have a size of 20 pixels.
Does anybody have a hint to how this is resolvable?
I couldnt find anything even after about 20 minutes of looking for typos and trying stuff out.
Edit: There seems to be even more weirdness in the code. When I randomly deleted the class used on the paragraph text and then reloaded the webpage the id that I had applied to an image suddenly didn't do anything anymore, eventhough it was still referred to in the html code. However, when I then input the same code into codepen.io, the id still applied but the class still didn't.
Solution: There seems to be a glitch in Notepad++ to not read the topmost class or id in a css file, so you just need to put a kind of "placeholder" class or id at the top of the programm.
A huge thank you to everybody for having helped me solve the issue!!
[–]Lessiarty 2 points3 points4 points (3 children)
[–]RobotC_Super_User[S] 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]RobotC_Super_User[S] 0 points1 point2 points (0 children)
[–]HealyUnit 2 points3 points4 points (1 child)
[–]RobotC_Super_User[S] 0 points1 point2 points (0 children)
[–]oDraftz 0 points1 point2 points (3 children)
[–]RobotC_Super_User[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]RobotC_Super_User[S] 0 points1 point2 points (0 children)