CSS and the Box Model
The next HTML project involved creating an invitation for an event utilizing Cascading Style Sheet, or CSS, and the Box Model. The Box Model is type of design that wraps HTML elements within a box, and it includes a margin, a border, a padding, and the HTML element. This model is ideal for invitations, because many of the existing invitation designs on paper already have the elements of margin, border, and padding. Part of the requirements for the project also included the use of bold or italic texts, utilizing different colored texts, and a hyperlink to an email (similar to the one used in the previous HTML project).
When it comes to choosing an event, I immediately thought of weddings, as I was just planning a wedding for this past summer. Even though the spread of COVID-19 obstructed those plans, my husband and I were still able to get married in a small, private ceremony. I thought it might be fun to create an invitation as if our wedding were the large gathering of family and friends we had originally planned. This decision turned out to be very important, as this project suddenly became very personal to me. I wanted the invitation to resemble a real wedding invitation as closely as possible, which, in turn, affected a lot of my design choices.
As with last time, I utilized the TryIt Editor on WW3 so I can see the result of my codes in real time. The biggest obstacle, by far, coding the elements so that they appeared exactly the way I envisioned. The Box Model was easy enough; all you had to do was to set the values for the margin, border, and padding. However, it was the layout of the actual elements within the box that required a lot of adjusting. I wanted our names on the invitation to be a different font from the rest of the texts, but I also did not want to use too much in-line CSS. I found the use of classes in HTML to be a great solution, as it greatly reduced the amount of coding I had to do. Instead of writing in-line CSS and separating our names into individual paragraphs, I simply assigned the class "names" to our names and defined the font, size, and bold text as a class. I also used the class "content" to designate the overall text structure in the Box Model. This saved me a lot of work as I did not have to format each individual paragraph.
Finding the font for the names on the invitation also proved to be challenging. Many of the fonts that I liked that resembled what I see on many wedding invitations were not available on Google fonts. I eventually found Dancing Script and used that for our names on the invitation to put a wedding-esque touch to the invitation.
By far the biggest thing I learned through this project was the use of HTML classes. This is a great way to style many components without overloading the code with in-line styling. It saves a lot of time and energy, and the code also appears much cleaner, too. I also look forward to using the Box Model again in the future. Having seen many examples on WW3, it made it realize how widely utilized it is.
Comments
Post a Comment