Really to me CSS is what makes a website's code clean and manageable. The ability to separate your form from your function is super important when it comes to figuring out issues in your code. CSS allows for just that. Another really neat feature of CSS is that fact that the user has control of style. If there's troubles with your stylesheet or they've turned them off, working with an external stylesheet allows you to think critically and ensure that the page is still functional whether or not your styles exist. When using artistically placed divs or building off of a background image, sometimes this can be an issue, and it's so critical to ensure that your basic information is accessible even if the aesthetics are gone.
CSS makes a lot of sense to me as a programmer because it looks so similar to a class definition in Java (or any other object oriented programming language really). You consider this specific aspect of your page - that header, this image - and all of the properties you want to define in it. The best part is the re-usability, much like Object Oriented Programming. If I've defined a red circle for my page and I want twenty more of them, I don't have to rewrite all the HTML tags over and over again. I've got that red circle defined, I just need to call it again, which is much less code and makes a lot more sense to someone viewing my code. I feel like in this respect those who enjoy or find CSS comes easy have a natural knack for such types of programming languages if they were so inclined.
Attaching external stylesheets is something I've only recently gotten the hang of, but I know its importance and I'm so glad I've been able to. Something else really cool that I've been learning about (and that I strugglebus-ed with for a little bit on my personal webpage) is that idea of hierarchy continuing into the stylesheets themselves. how italicized text inherits from the body, and the body inherits from the page...so on and even more specific. It's so cool that you can solve some styling problems simply by defining multiple styles for a certain type of object, and that specificity and "what rules over what" - the hierarchy concept that was explained in the reading, is definitely something that's been interesting me as of late.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.