1. Blocked on a Simple Problem
My main.css stylesheet was a mess of duplicate classes and styles that I had used over different pages. I also noticed that I had a bunch of error messages in my code. The first thing I did was to go through the code and isolate the error messages. For example:
-
Fixed a typo in my
blockquote(var(var(--primary-color))→var(--primary-color)) - Fixed a missing semicolon in
.story
It was a great feeling once I had saved my work to see main turn from red!
The lesson I took from this was to pause and check things carefully (particularly with CSS). With JavaScript, if something's not working I think I will realise that there is an error and I cna troubleshoot, but CSS is more subtle. I also learned that when I build multi-page websites, I should treat them as parts of a whole rather than separate entities.
2. Elegantly Solved a Problem
Once the obvious errors were fixed, I turned to improving the structure of my stylesheet. These are the changes that I made:
- Grouped repeated backgrounds, border-radius, box-shadows, transitions into shared blocks.
-
Combined
.navbarandnavwhere they shared base styles. - Removed duplicate hover/transition definitions.
-
Fixed
blockquotetypo and.storymissing semicolon. -
Simplified repeated
pre,code, andul/lispacing rules.
This felt much more elegant, and I was really satisfied with the cleaner result.
3. Reflection on Problem-Solving Techniques
I feel confident using:
- Pseudocode:helpful for structuring before coding.
- Googling:great for looking up syntax or approaches.
- Reading error messages:particularly after this exercise.
- Console.logging:a tool I’m very comfortable with.
I haven't yet had to, but I feel okay about:
- Asking for help:from peers or coaches when needed.
And finally, I've learned the value of:
- Reflectionit helped me identify mistakes, spot repetition, and improve my process overall. And boy, did I do a lot of reflection!