Tuesday, June 24, 2014

HTML and CSS

I spent the first half of the day with my girlfriend, then at 7 p.m. I continued with my treehouse education.  In one of the HTML videos, the instructor noted that red highlighting on an HTML tag meant that the workspace was letting me know that a tag was not closed somewhere in that area. When he said that, I noticed that I had a tag that closed a list item, "</li>" highlighted in red. I scanned my html code up and down, but I couldn't find any unclosed tags in the area. I knew something was wrong, but I wasn't sure what. I went over all the html code again, but noticed nothing wrong. Then I looked at the code right below and above the "</li>" tag and noticed "<a/>" above it! That was the issue! I had closed the anchor incorrectly! I then changed the tag to "</a" and the red highlighting was gone.  

Sweet! 

Also, I was wondering what the difference was between an "element" and a "tag," as the two seemed to be used interchangeably, so I ran a search online and ended up at stackoverflow, a forum on the subject of web development. Someone has already asked the question, and the best answer was as follows: 

"HTML tag is just opening or closing entity. For example:

<p> and </p> are called HTML tags
HTML element encompasses opening tag, closing tag, and the content (optional for content-less tags), like so: 
<p>This is the content</p> : This complete thing is called a HTML element"
-- End Quote

So there you have it. Now I know the difference between an element and a tag, and I found and corrected my first mistyped code.
I earned the CSS Cascading Style Sheets badge from treehouse today at 10:30 p.m., so that took 3 and a half hours from 7 p.m., when I started. I didn't just race through the class though, I kept changing the code around to really understand what was happening, and also, I kept rewinding and replaying the videos if I felt I missed any little thing. Treehouse is amazing.

After earning the badge, I took a two hour break to browse the treehouse forum and website, munch on some fruits, and talk to my brother back in the U.S. I'm looking forward to heading back home and spending time with my family. After that long break, I started up again at 12:30 at night and kept it up until 2:30, learning more about CSS. 

Badge Earned Today: CSS Cascading Style Sheets


Hours Spent Coding Today: 5.5
Total Hours Coding: 5.5

No comments:

Post a Comment