An enum is a special data type that allows you to declare and query data with string variables but stores an integer in the database. You can think of an enum as being able to set a variable to a value (for Ruby on Rails, its an integer value). For example, if you want a status column in your database model, you could set the status to enum type and store your possible statuses started, in progress, and complete, as 0, 1, and 2.
Not only does this let developers write more semantic code, but it’s also more space-efficient, less bug-prone, and easy to update down the road! …
Positioning lets you take specific elements our of the normal document flow and change their behavior. Below is guide on how each one works, with examples to boot.
The CSS code looks pretty similar regardless of the type of positioning your design requires:
By default, HTML elements are positioned in line with the normal document layout flow. Static position can be explicitly specified like this:
although it’s usually unneccesary.
Relative positions element relative to its in-line placement in the document. For instance in the example above, the Relative orange element is positioned 50px from the left and 10px from the top of its inline placement. Notice also that the space the element took up in it’s inline placement is still left over. The elements beneath it didn’t move in to fill the gap. That’s because it hasn’t actually been taken out of the document flow, so it’s spacing is still accounded for. …
While it’s easier (and better practice) to design and style your app for various screen sizes from the beginning, it IS possible to add responsive design to your projects after you’ve begun. Want to retroactively add responsiveness to an existing app? Here are 6 tips to get you started.
Learning to code in a Bootcamp program has lots of advantages. …