<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: vance</title>
    <description>The latest articles on DEV Community by vance (@caesiumtea).</description>
    <link>https://dev.to/caesiumtea</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F810146%2F7251e00b-c3e8-43de-99f9-dedc89b35f38.jpg</url>
      <title>DEV Community: vance</title>
      <link>https://dev.to/caesiumtea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/caesiumtea"/>
    <language>en</language>
    <item>
      <title>Learning in public</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Fri, 07 Feb 2025 22:20:00 +0000</pubDate>
      <link>https://dev.to/caesiumtea/learning-in-public-56b4</link>
      <guid>https://dev.to/caesiumtea/learning-in-public-56b4</guid>
      <description>&lt;p&gt;Have you heard the advice to "learn in public" yet?&lt;/p&gt;

&lt;p&gt;A friend just asked an interesting question in a coding group chat that I belong to: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;For all my friends here that learn - or learned - in public, how did you go about that, and did you notice that it made a difference in helping get a job and/or expediting your learning? I've been trying to come up with some sort of plan, but have been having trouble figuring out what to do or how to do it.&lt;/em&gt; -- &lt;a href="https://github.com/DevLoggith" rel="noopener noreferrer"&gt;Logan&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In trying to reply, I ended up gathering quite a few resources and recommendations together, so I figured I might as well take all those links and thoughts I just gathered and make a blog post of it! &lt;/p&gt;

&lt;p&gt;So first of all, what do we mean when we say "learn in public"? It's very similar to the &lt;a href="https://www.cccreative.design/blogs/what-is-buildinpublic-a-comprehensive-guide-to-transparent-development" rel="noopener noreferrer"&gt;"build in public"&lt;/a&gt; movement among developers, which encourages sharing your projects while they're still in progress instead of only after they're complete, allowing folks to see your entire development &lt;em&gt;process&lt;/em&gt; instead of only the product. Learning in public means taking that approach to your entire journey of learning to code--or learning anything, for that matter, but the term does seem to originate in the coding community.&lt;/p&gt;

&lt;p&gt;This &lt;a href="https://www.swyx.io/learn-in-public" rel="noopener noreferrer"&gt;blog post by swyx&lt;/a&gt; is what I'd consider the 'learn in public manifesto' and may or may not be the origin of the phrase. It briefly outlines the how--by creating what they call "learning exhaust" like tutorials, Twitch streams, or Stack Overflow answers--and, more obliquely, the why--to network and build connections, to learn faster by teaching and by getting feedback. &lt;/p&gt;

&lt;p&gt;I really adore the learn in public movement (can I call it a movement?). I love seeing what other people are learning. Sometimes it's just curiosity, but also, even though the information might not be as sound, there's something so much more relatable and comfortable about reading the messy notes of a fellow learner instead of only ever tutorials from experts. Seeing someone else's learning journey, especially when they're learning something similar to me, makes me feel like I'm not alone in my efforts and boosts my motivation and resilience--and boy do you need resilience when you're learning to code, haha. What's even better is when you actually reach out to talk to your fellow learners, get to know some of them, and start growing a real sense of community. That's how I ended up in this little group chat where the question was asked in the first place! &lt;/p&gt;

&lt;p&gt;I really enjoy sharing my own learning too, besides enjoying when other people do. I like creating a record that I can look back on to see how much I've grown, especially when I feel dispirited about how far there still is to go to reach my bigger learning goals, or just when depression has me feeling like I can't do anything. And when I write a tutorial or blog post, that's a great resource for my future self to come back to later when I forget how to do the thing. Likewise, recording general notes about your learning creates a useful resource you can review later when you need a refresher--a resource customized to the way that &lt;em&gt;you&lt;/em&gt; think and the specific items that you had struggled with or been most interested in--and posting my notes publicly instead of keeping them private gives me a little push to care more about keeping them well-organized and understandable, which again benefits myself when I'm reading them later. Writing tutorials is great too; it really helps crystallize your knowledge when you have to think about how to explain it in a way someone else could understand, and I even found that it helped me create connections between different concepts when I had to explain what background knowledge my tutorial required or when I found myself feeling like I should throw in a "learn more here" link to another topic (and building connections is reputed to be be a cornerstone of how we learn, at least according to the course Learning How to Learn). And I love that it might even be able to help someone else learn, perhaps!&lt;/p&gt;

&lt;p&gt;But does learning in public actually get you &lt;em&gt;results&lt;/em&gt;? Let's go back to what Logan asked: can it help you get a job? Can it help you learn faster?&lt;/p&gt;

&lt;p&gt;Well, I have to admit, in my experience of learning in public I've never directly observed any &lt;em&gt;concrete&lt;/em&gt; benefits like that, only the more abstract stuff like motivation (which is hard to accurately attribute to a cause). Or like, yeah it's nice that I have these personalized notes I can look back to, but do I actually learn faster because of that? I can't say. But it's worth noting, I've personally done only a minimal amount of learning in public. I've only written one or two blog posts/coding tutorials; I only kept a daily progress log for 46 days; I only took and published notes for about half of one course. So it kinda makes sense that I haven't gotten much out of it, since I haven't put much into it either. &lt;/p&gt;

&lt;p&gt;One thing to note about the question of "learning faster": if you're measuring that in terms of say, how long it takes you to complete a course, and if you only have a limited amount of time/energy to dedicate to learning, then maybe it won't help with the &lt;em&gt;speed&lt;/em&gt; of your learning--just because the act of learning in public itself &lt;em&gt;takes up time&lt;/em&gt;, too. It takes time to write a blog post or answer Stack Overflow questions. Sharing notes takes time if you care about making your notes look "presentable" (I strongly encourage sharing raw, messy notes anyway!). Even small things like writing a one-line daily log or making a tweet about what you learned today have some cognitive overhead that could potentially draw from your pool of energy for the learning itself. Then again, do you just want to complete a course faster, or do you want to reach &lt;em&gt;mastery&lt;/em&gt; faster? Because there's a difference there too, and it's possible that taking more time upfront can lead to deeper or more thorough understanding and allow you to "level up" faster in the long run.&lt;/p&gt;

&lt;p&gt;I suspect that learning in public actually &lt;em&gt;could&lt;/em&gt; help you get a job or learn faster/better, but it hinges on actually getting noticed. Any time you're publicly talking about coding (or whatever your field is), you create the opportunity to network with others in the field, and networking is well known to be a major factor in finding jobs. Some of the things that can help you learn faster are if others ask you questions, or conversely, if someone who's &lt;em&gt;more&lt;/em&gt; experienced than you sees your notes and notices you've made a mistake and reaches out to correct you. But those things can only happen if people actually find you, and well, the state of the internet is such that people &lt;em&gt;don't&lt;/em&gt; always actually notice you, and even fewer of them actually decide to reach out and say something. Personally, I don't recall ever having any meaningful interactions as a result of my attempts at learning in public. So, your mileage may vary, and you can only get out as much as you put in. (There are probably ways to try to get more noticed, like posting under hashtags, but that's a whole separate conversation and it's out of my wheelhouse.)&lt;/p&gt;

&lt;p&gt;But okay, let's say you've made up your mind that you want to try learning in public. How do you actually go about it?&lt;/p&gt;

&lt;p&gt;The short answer is, you just talk about what you're learning somewhere public like social media. Or you write notes/blogs/tutorials and you put them somewhere. (Or of course there's a million other things you could do, like hosting livestreams while you study/code, going on forums and answering other people's questions, whatever.)&lt;/p&gt;

&lt;p&gt;But when I saw Logan's question, the very first thing that came to mind for me was daily coding challenges like &lt;a href="https://www.100daysofcode.com/" rel="noopener noreferrer"&gt;100 Days of Code&lt;/a&gt; or Codedex.io's &lt;a href="https://www.codedex.io/30-nites-of-code" rel="noopener noreferrer"&gt;30 Nites of Code&lt;/a&gt;! This is really what got me started on posting about what I was learning. The great thing about these challenges is that the community aspect is built in--there are all kinds of social media tags, Discord servers, etc that people who do these challenges use to find each other and spread encouragement (encouraging other participants is even one of the official rules of the 100 Days of Code challenge!). So that definitely helps with the "getting noticed" point above.&lt;/p&gt;

&lt;p&gt;I got 46 days into the 100 days challenge, and for those 46 days, I kept a &lt;a href="https://caesiumtea.notion.site/100DaysOfCode-4583cd6596e2416599418884cddc1911?pvs=74" rel="noopener noreferrer"&gt;daily log in Notion&lt;/a&gt; of what I worked on each day (and then also posted it on Twitter each time). You can check that link to see exactly what I was recording each day, and feel free to copy for your own learning tracker! One of the especially useful elements of it for me was the "what I learned" box, where I tried to distill one key takeaway out of each day of learning. It doesn't have to be limited to 100 (or 30) days, of course, and you don't have to be participating in one of these challenges to just start your own similar log of what you learn each day. There's also an official &lt;a href="https://github.com/kallaway/100-days-of-code" rel="noopener noreferrer"&gt;GitHub repo for logging progress with 100 Days of Code&lt;/a&gt;; you can check out the forks to see some other &lt;a href="https://github.com/Sazid99246/100-days-of-code/blob/master/r1-log.md" rel="noopener noreferrer"&gt;examples of how people log their daily learning&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The other big option is to post blogs or notes. It's pretty simple to start a blog right here on Dev.to, or on &lt;a href="https://hashnode.com/" rel="noopener noreferrer"&gt;Hashnode&lt;/a&gt;, two blogging platforms specifically for coding. There's also a great community platform on &lt;a href="https://www.codedex.io/community" rel="noopener noreferrer"&gt;Codedex.io&lt;/a&gt; where you can write blog posts, although you do need to complete a few lessons to "unlock" the community features. In these cases, there's already an audience and community on the site, so it's easier for your posts to get seen. If you want a more personalized blog, or want to blog about learning other stuff besides coding, you can try &lt;a href="https://substack.com/" rel="noopener noreferrer"&gt;Substack&lt;/a&gt;. If you wanna get fancy, you can even self-host the similar blogging platform &lt;a href="https://ghost.org/" rel="noopener noreferrer"&gt;Ghost&lt;/a&gt;, &lt;a href="https://blog.caesiumtea.com/building-the-blog/" rel="noopener noreferrer"&gt;like I do for my art blog&lt;/a&gt;! (Self-hosting is a great learning experience in and of itself!) IMO, these options are best when you want to write more focused and thought-out pieces like tutorials and guides, or even just "here's everything I know about CSS selectors" or whatever. Basically, I turn to these blogging platforms when I'm writing directly for the sake of informing other people. &lt;/p&gt;

&lt;p&gt;On the other hand, when you just want to share your casual working notes that are written mainly to yourself, you can get a better workflow with other platforms. I really like Notion for learning notes. In fact, here you can see my &lt;a href="https://caesiumtea.notion.site/learning-notes-aefb8c96996e4733ab8e51c5987458d5?pvs=4" rel="noopener noreferrer"&gt;general directory of learning notes&lt;/a&gt; on all different topics. Some are complex sets of sub-pages, like my &lt;a href="https://caesiumtea.notion.site/FCC-Responsive-Web-Dev-notes-65373db97d59482cadb50d35b94a6fa9" rel="noopener noreferrer"&gt;notes for the freeCodeCamp web dev course&lt;/a&gt; which include the each project's code and an overall glossary alongside individual lesson notes, and others are just short blurbs, like my &lt;a href="https://caesiumtea.notion.site/Linux-0e552805c208480f9d342ba8672ce2f7" rel="noopener noreferrer"&gt;Linux notes page&lt;/a&gt; which currently only contains a list of what each folder in the Linux file system is for. But who knows, by the time you read this blog post maybe I've added more! And that's the great thing about Notion for note-taking: it's a living document that you can easily keep editing and building upon, with it available as a live site all the while. The other advantage of Notion is being able to nest pages inside each other or quickly create links between them, much more efficiently than you could link different Hashnode posts to each other, for instance--so you can do what I did for freeCodeCamp and have one page for a course, with subpages for each lesson or topic, all bundled up together. &lt;/p&gt;

&lt;p&gt;Another interesting option can be to write your notes as Markdown files in a public Git repo hosted on GitHub/GitLab/etc, like &lt;a href="https://github.com/heyjiawei/learnInPublic" rel="noopener noreferrer"&gt;this person did&lt;/a&gt;. It can be nice to have it live in the same place as your code and means that folks like recruiters might see it when checking out your projects, and it doesn't disrupt your workflow as much if you spend most of your study time in a code editor (you can browse, write, and publish your notes all from within VS Code for instance).&lt;/p&gt;

&lt;p&gt;Of course, if you want that crucial community engagement and feedback on your notes that are hosted on Notion or GitHub or wherever else, I recommend posting a link to your notes on social media each time you add something new to it.&lt;/p&gt;

&lt;p&gt;So how about it? What are you learning, and what do you have to say about it?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Cross-posted from &lt;a href="https://www.codedex.io/community/general/EnL2QzpKvWpgAoDf1L8M" rel="noopener noreferrer"&gt;Codedex Community&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>beginners</category>
      <category>community</category>
    </item>
    <item>
      <title>How to prepare for a coding bootcamp</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Fri, 29 Dec 2023 01:16:51 +0000</pubDate>
      <link>https://dev.to/caesiumtea/how-to-prepare-for-a-coding-bootcamp-hkb</link>
      <guid>https://dev.to/caesiumtea/how-to-prepare-for-a-coding-bootcamp-hkb</guid>
      <description>&lt;p&gt;Are you planning to participate in a coding bootcamp? That’s awesome! It’s a big commitment to make, though, and it can really disrupt your daily life. It’s a good idea to take some time before the bootcamp starts to plan out your approach. Doing so will increase your chances of sticking it out until the end, set you up to learn more effectively, and let you feel better while doing it.&lt;/p&gt;

&lt;p&gt;This article can apply to any kind of coding bootcamp, but was written especially for people getting ready to join the &lt;a href="https://badwebsite.club/" rel="noopener noreferrer"&gt;Bad Website Club web development bootcamp&lt;/a&gt;. This free bootcamp by &lt;a href="https://twitter.com/jesslynnrose" rel="noopener noreferrer"&gt;Jess&lt;/a&gt; and &lt;a href="https://twitter.com/hola_soy_milk" rel="noopener noreferrer"&gt;Ramón&lt;/a&gt; kicks off on 1/5/24!&lt;/p&gt;

&lt;h2&gt;
  
  
  Make a trade
&lt;/h2&gt;

&lt;p&gt;It’s a bad idea to expect yourself to take on a major new commitment like a coding bootcamp while still maintaining every other part of your routine. What are you willing to let go of during this time period in order to make space for learning to code? Don’t just think about making time, but also about energy and exertion.&lt;/p&gt;

&lt;p&gt;I often see people saying they’re going to give up recreation time, like watching TV, and replace it with learning to code. I don’t know how many of those people it actually works out for, but I can tell you, it didn’t work for me. That’s because, even though I freed up my &lt;em&gt;time&lt;/em&gt;, cutting out my relaxation time didn’t free up any &lt;em&gt;energy&lt;/em&gt; that I could use for hard mental work—instead, losing my “cool off” time made me more stressed than ever, so I wasn’t able to focus well enough to actually learn effectively, and quickly burned out and gave up.&lt;/p&gt;

&lt;p&gt;Instead, try asking yourself if there are other &lt;em&gt;commitments&lt;/em&gt; that you can cut back for the duration of the bootcamp. Can a project be delayed until after the bootcamp ends? Is there a hobby or side hustle that you’re willing to stop working on for a while? Can somebody else take over one of your responsibilities now in exchange for you taking on their part after the bootcamp? It could even be a matter of temporarily lowering the standards you hold yourself to, like giving yourself permission for your house to get messy during this time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prepare a routine
&lt;/h2&gt;

&lt;p&gt;Make sure you know how many hours per week the bootcamp expects its students to study, both in class sessions and on your own. Where does this fit into your existing schedule? Choosing what to let go of might have already given you an idea of where the bootcamp will fit in your schedule.&lt;/p&gt;

&lt;p&gt;If you can choose a specific time and place where you’ll do your studying, it should make you more likely to stick to the habit. This is also a good time to physically clear off your desk or otherwise prepare a good studying environment that will help you focus.&lt;/p&gt;

&lt;p&gt;Think also about how you’ll pace yourself over the length of the bootcamp. It’s easy to dive in too deep at the start and then run out of steam before the end. If your bootcamp doesn’t provide deadlines for the assignments, maybe try coming up with your own plan about how many days to allot yourself for each round of homework. &lt;/p&gt;

&lt;p&gt;Just remember that you can—and probably should!—adjust your routine once you actually start on the bootcamp, when you have more information about how much time the work actually takes for you to complete. Your personal pattern will probably be at least a little different from the “average” completion time. Everyone has their own pace, and it’s totally okay if your work time is different from someone else’s!&lt;/p&gt;

&lt;h2&gt;
  
  
  Anticipate setbacks
&lt;/h2&gt;

&lt;p&gt;We always hope that life will be nice and let us focus on our goals, but when a bootcamp is months long, it’s just inevitable that at some point, life will get in the way and you won’t be able to stick to the schedule you planned. Or you’ll run into that one pesky assignment that you really struggle to complete. It’s okay! It happens to everyone! The most important thing is that, when this happens, you &lt;em&gt;don’t give up&lt;/em&gt;. Believe in yourself and just keep taking whatever the next step is! &lt;/p&gt;

&lt;p&gt;Maybe this is controversial advice, but giving less than 100% effort can actually be a valuable strategy to make the most of your limited time, especially if you fall behind. You may be able to catch back up by just not putting as much effort into the backlogged work. It’s much more effective to let yourself learn some of the material imperfectly than to give up and not finish the course at all!&lt;/p&gt;

&lt;p&gt;On the other hand, does your bootcamp have a deadline for completing the program? If it’s like the Bad Website Club bootcamp and has no deadline, then don’t sweat it and just keep going at your own pace. There’s nothing wrong with finishing the program later than expected. &lt;/p&gt;

&lt;p&gt;Or maybe there will come a point when you lose sight of your motivation for taking on the bootcamp in the first place. Think about that right now—why do you want to do this bootcamp? Is there a dream you’re chasing? Maybe you want to change your career to provide a better life for your family, or maybe you want to make a video game so that you can share a cherished idea with the world. Think about both what goal the bootcamp will help you accomplish, and also why that goal is meaningful and important to you. Then write this down, and put it in a place you’ll see it when you’re studying.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consider your wellness
&lt;/h2&gt;

&lt;p&gt;Besides being time-consuming, bootcamps can also be a stressful or exhausting experience. How will you look after yourself during this time? What can you set up now to make your self-care easier during the bootcamp? Maybe this means buying easy-to-prepare foods to make sure you can still eat enough even if you’re worn out, or starting a mood journal that you can use to monitor how you feel during the bootcamp. Think again about the routine that you’re planning, and make sure to book dedicated time to decompress and care for yourself in addition to study time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet people
&lt;/h2&gt;

&lt;p&gt;Does your bootcamp have a Discord, Slack, forum, or other way to communicate with classmates that you can already access before the bootcamp begins? It can be nice to start chatting there and get to know some of the people who you’ll be learning alongside! In my experience, it makes all the difference in the world to feel like you’re not in it alone, and the sooner you start building those relationships, the sooner you can reap the benefits of feeling like you’re part of a community. Plus, if you need to ask your peers for help later in the bootcamp, I find that it’s less scary to do if you already know some of the people.&lt;/p&gt;

&lt;p&gt;If you’re joining the Bad Website Club bootcamp, then the Bad Website Club Discord server is a great place to introduce yourself, talk about your goals, and start getting to know your fellow learners!&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: Check your foundational knowledge
&lt;/h2&gt;

&lt;p&gt;This article focused mainly on how to prepare your lifestyle for the bootcamp, but you may also want to check how prepared you are for the curriculum. See if your bootcamp posts a list of prerequisites. If it’s a bootcamp for complete beginners (like the Bad Website Club bootcamp) then you probably don’t need to worry much about this, but you may still want to review this page from The Odin Project about &lt;a href="https://www.theodinproject.com/lessons/foundations-computer-basics" rel="noopener noreferrer"&gt;computer basics&lt;/a&gt; and make sure everything at least sounds familiar. If your bootcamp is related to web development, then you might also be interested in The Odin Project’s lesson on &lt;a href="https://www.theodinproject.com/lessons/foundations-how-does-the-web-work" rel="noopener noreferrer"&gt;how the web works&lt;/a&gt; to gain some extra context for the work you’ll be doing.&lt;/p&gt;

&lt;p&gt;Good luck with your bootcamp, and please don't forget to take care of yourself along the way!&lt;/p&gt;

</description>
      <category>bootcamps</category>
      <category>mindset</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Learning about Docker</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Tue, 07 Nov 2023 09:09:58 +0000</pubDate>
      <link>https://dev.to/caesiumtea/learning-about-docker-373b</link>
      <guid>https://dev.to/caesiumtea/learning-about-docker-373b</guid>
      <description>&lt;p&gt;Today I spent some time learning about Docker, and I wanna try to solidify that learning by recapping it for myself here!&lt;/p&gt;

&lt;p&gt;I've been meaning to learn about Docker for a long time, but why did I finally look into it today? Well, as you can see from my &lt;a href="https://www.codedex.io/community/post/j7vpRbgBRKrtFPZpOFjF" rel="noopener noreferrer"&gt;previous post on Codedex&lt;/a&gt;, I've been learning about web servers lately, and trying to set up different websites for my art stuff. Since yesterday I've been looking into building my own ecommerce storefront to sell my art from, and today I saw someone saying that the fastest way to install a certain ecommerce platform (Magento) was via Docker. So I figured, might as well finally get around to learning it! I'll also need it for some of the stuff I'm trying to do with my Raspberry Pi, I think.&lt;/p&gt;

&lt;p&gt;So first, what's the point of Docker? It's a way to bundle up an application together with all of the system configuration required to run it. It makes it easier to move the app you're coding between environments--like from your local development environment to a deployment--without having to manually configure everything based on the details (like OS and architecture) of each machine. It lets you kind of ignore the particulars of what computer you're running the Docker container on, and guarantee that the system will be configured in a well-defined way. I think the reason that the one dude said Docker was the fastest way to run Magento is that the Docker image he was using includes all the dependencies Magento requires, along with all the configs needed for each of them, and so you can just install this one Docker image in a single step instead of having to go through the installation and setup of each dependency one by one and manually configure them all to talk to each other correctly. Somebody else &lt;em&gt;already did&lt;/em&gt; the step of configuring them to talk to each other, and saved it to this Docker image.&lt;/p&gt;

&lt;p&gt;By the way, a "Docker image" is a file that contains the source code that you want to run, and a "Docker container" is the live instance running a Docker image. &lt;/p&gt;

&lt;p&gt;Docker is a type of virtualization technology, but it's not the same as a virtual machine. A virtual machine encapsulates the entire operating system, including the kernel. But a Docker image only includes the "application layer" of the operating system, &lt;em&gt;not&lt;/em&gt; the kernel. This makes Docker images way smaller files than the images(?) for virtual machines, and makes Docker containers much faster to create. A Docker container actually uses the kernel of the host machine that it's running on! &lt;/p&gt;

&lt;p&gt;(Interesting sidenote: This means that Linux-based Docker images should only be able to run on Linux machines! How did they deal with this to allow devs to work with Docker containers from Windows or Mac computers? Well, the Docker Desktop software that you have to install to run Docker on Windows or Mac actually creates a Linux virtual machine to run your containers on top of!)&lt;/p&gt;

&lt;p&gt;(Sidenote to the sidenote: There's a Docker Desktop for Linux too, and these days Docker encourages you to install via Docker Desktop even on Linux, but apparently it is VERY picky in its system requirements, and it isn't compatible with the XFCE desktop environment that I use! So after way too much troubleshooting, I had to just uninstall Docker Desktop and try again with the old school Docker Engine packages.)&lt;/p&gt;

&lt;p&gt;To start working with Docker containers, you need to install the Docker software on the computer you're working from--and if you want to deploy your app via Docker, then you also need to install Docker on the deployment environment. Like in my case, if I want to use Docker for my Magento store, I'll need to install Docker itself on the server that my store will be hosted on first, before I can create the Magento container there.&lt;/p&gt;

&lt;p&gt;Once you have Docker installed, you just need to start the service/daemon, and then you can start running Docker commands from the terminal! There's a bunch of commands you can use to download Docker images, and to start and stop and manage containers, but I'm not going to bother listing out the details because it's easy enough to look up the commands when needed. Here's a nice &lt;a href="https://christitus.com/docker-guide/" rel="noopener noreferrer"&gt;guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The workflow is like this: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;   Start the Docker service (you can set this up to happen automatically)&lt;/li&gt;
&lt;li&gt;   Download (pull) the Docker image that contains the app you want to run&lt;/li&gt;
&lt;li&gt;   Create and start a container from that image&lt;/li&gt;
&lt;li&gt;   Access the container's app through a certain port on your computer&lt;/li&gt;
&lt;li&gt;   Stop the container when you're done&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to actually interact with the app that's running inside the container, then you need to do what's called binding a port. This is an argument you pass in while creating the container that tells your computer that, if you try to visit a certain port, direct that request to the port inside of this container instead. For example, if you're running a web server in a Docker container, that would normally be available over HTTP on port 80 of the server--but in this case, that refers to port 80 &lt;em&gt;inside&lt;/em&gt; the virtual system. Port binding means telling your real, physical computer "hey, when I look at &lt;em&gt;your&lt;/em&gt; port 80, I want you to pull up this Docker container and show me what's on &lt;em&gt;its&lt;/em&gt; port 80." It doesn't even need to be the same number! That's really useful for if you have like, 3 containers on your computer that are all running web servers and all expect to be on port 80--they can all be on their own internal port 80 at the same time, meanwhile they're each bound to a different number of external port, so they're all available at the same time. &lt;/p&gt;

&lt;p&gt;(By the way, I don't really understand ports or networking, so my language might not be quite right... please correct any mistakes I made!)&lt;/p&gt;

&lt;p&gt;Lastly, all of that was assuming you're working with an image that contains somebody else's code. But what about when you want to actually put your own code into a Docker image? You write what's called a Dockerfile in your project directory, and use that (with a terminal command) to build your image! Then you can use it just like any other image. If you're like me, maybe you've been seeing these files called "Dockerfile" in Git repos for a long time and wondering what they're for, right? It feels so good to finally know what it does, haha. If you look inside one of these, it's a pretty straightforward text file. It's just a bunch of instructions that tell Docker how to make your image. Interestingly, it always needs to begin by calling out a pre-existing Docker image that will be used as the basis of your image! For instance, this might be an image that just contains the basic operating system files, or it might be an image pre-configured with something like Python or Node. (It does make me very curious about how those "starter" operating system images get created though!) Then, you add instructions to copy your local files into the Docker image, and commands to run to set up the environment, like &lt;code&gt;npm install&lt;/code&gt;. Then there's always one last command that tells Docker how to start your app itself, like by executing a certain file.&lt;/p&gt;

&lt;p&gt;And I think that's about everything I learned today! Phew! Sure looks like a lot now that I've written it all out... but I haven't even started experimenting with &lt;em&gt;using&lt;/em&gt; Docker myself yet. All I did was install the software and run the hello-world Docker container to test my installation. Looking forward to trying out that Magento Docker image that I was reading about, though!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://www.codedex.io/community/post/ezakJ7X21ZOKSYjIipJ7" rel="noopener noreferrer"&gt;Cross-posted to Codedex.io Community&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>docker</category>
    </item>
    <item>
      <title>BWC Bootcamp Recap: Week 3</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Thu, 24 Aug 2023 06:05:34 +0000</pubDate>
      <link>https://dev.to/caesiumtea/bwc-bootcamp-recap-week-3-1lj5</link>
      <guid>https://dev.to/caesiumtea/bwc-bootcamp-recap-week-3-1lj5</guid>
      <description>&lt;p&gt;Hello friends and learners! Can you believe we’re more than halfway through the &lt;a href="https://badwebsite.club/webdev-bootcamp-2023.html" rel="noopener noreferrer"&gt;Bad Website Club web dev bootcamp&lt;/a&gt; already? Don’t worry if you’re not that far along yet yourself though—there are no deadlines here and you’re free to complete the work at your own pace.&lt;/p&gt;

&lt;p&gt;There was a lot of material this week, but fortunately, many of the topics appeared in more than one lesson. This time the post is organized by topics addressed instead of by freeCodeCamp lesson. I hope this helps you make more connections between what you did in the different lessons and see more of the big picture of what you’re capable of now!&lt;/p&gt;

&lt;h3&gt;
  
  
  Accessibility
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;role&lt;/code&gt; attribute is used to tell assistive technology what the &lt;em&gt;purpose&lt;/em&gt; of an element is. It’s particularly important on elements that don’t already have semantic meaning built in. This is part of the system called ARIA (Accessible Rich Internet Applications).&lt;/li&gt;
&lt;li&gt;When you assign the &lt;code&gt;role&lt;/code&gt; as &lt;code&gt;region&lt;/code&gt;, you can use the &lt;code&gt;aria-labelledby&lt;/code&gt; attribute to indicate which text acts as a name for the region.&lt;/li&gt;
&lt;li&gt;Navigation is a key aspect of accessibility! Using semantic HTML elements to structure the page create accessible navigation. These elements include header, nav, main, section, article, and footer.&lt;/li&gt;
&lt;li&gt;Visual accessibility: Choose a typeface that remains legible even at low resolutions. Also, there needs to be enough color contrast between text and its background. You can use a &lt;a href="https://webaim.org/resources/contrastchecker/" rel="noopener noreferrer"&gt;color contrast checker&lt;/a&gt; to help.&lt;/li&gt;
&lt;li&gt;Inputs should have a &lt;code&gt;label&lt;/code&gt; element connected to their &lt;code&gt;id&lt;/code&gt;, as we learned in the lesson on forms.&lt;/li&gt;
&lt;li&gt;Sometimes we want certain text to be read by a screen reader but not visible on the page. In those cases we can create a “screen reader only” class, often called &lt;code&gt;sr-only&lt;/code&gt;, and give it a certain set of properties that make it invisible. You can learn more about this method at &lt;a href="https://webaim.org/techniques/css/invisiblecontent/" rel="noopener noreferrer"&gt;WebAIM&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Conversely, to make an element hidden from assistive technology, put the attribute &lt;code&gt;aria-hidden="true"&lt;/code&gt; in the opening tag. Of course, it’s important to keep the visual content and the screen reader content in harmony, so you should generally only use this on text if it’s repeated nearby in a screen-reader-only element.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scroll-behavior&lt;/code&gt; is a property that can be used to change what happens when you click on links to different sections within the same page, and make the page appear to scroll smoothly instead of jumping instantly to the new section. However, visual movement like this can cause problems for certain users. We should put this behavior inside a media query with the rule &lt;code&gt;prefers-reduced-motion: no-preference&lt;/code&gt; so that the effect doesn’t apply for users who have not requested low motion in their browser settings.  (See below for more on media queries!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tables
&lt;/h3&gt;

&lt;p&gt;Tables are a way to display &lt;em&gt;tabular data&lt;/em&gt;, or in other words, information that can be logically arranged into rows and columns. The &lt;a href="https://badwebsite.club/webdev-bootcamp-2023.html" rel="noopener noreferrer"&gt;Bad Website Club schedule page&lt;/a&gt; uses tables to organize the information, because that information consists of a series of items that all share the same categories. In that example, each day’s class makes up a &lt;em&gt;table row&lt;/em&gt;, and each category of information such as date or URL makes up a &lt;em&gt;table column&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start by making a &lt;code&gt;&amp;lt;table&amp;gt;&lt;/code&gt; element.&lt;/li&gt;
&lt;li&gt;The first element inside a table should be a &lt;code&gt;&amp;lt;caption&amp;gt;&lt;/code&gt; element, which describes what the table is about.&lt;/li&gt;
&lt;li&gt;Next, inside the table after the caption, add one &lt;code&gt;&amp;lt;thead&amp;gt;&lt;/code&gt; (table header) and one &lt;code&gt;&amp;lt;tbody&amp;gt;&lt;/code&gt; (table body). &lt;code&gt;thead&lt;/code&gt; will have the headings for the columns, and &lt;code&gt;tbody&lt;/code&gt; will contain the main data of the table.&lt;/li&gt;
&lt;li&gt;The data of an HTML table is grouped by rows. The children of both &lt;code&gt;thead&lt;/code&gt; and &lt;code&gt;tbody&lt;/code&gt; will be &lt;strong&gt;table rows&lt;/strong&gt;, or &lt;code&gt;&amp;lt;tr&amp;gt;&lt;/code&gt; elements.&lt;/li&gt;
&lt;li&gt;Then, within each row, the content gets split into cells. For the header, these should be &lt;strong&gt;table heading&lt;/strong&gt; &lt;code&gt;&amp;lt;th&amp;gt;&lt;/code&gt; elements. Regular non-heading cells are &lt;strong&gt;table data&lt;/strong&gt; &lt;code&gt;&amp;lt;td&amp;gt;&lt;/code&gt; elements. Both the &lt;code&gt;td&lt;/code&gt; and the &lt;code&gt;th&lt;/code&gt; elements get nested inside the &lt;code&gt;&amp;lt;tr&amp;gt;&lt;/code&gt;'s.&lt;/li&gt;
&lt;li&gt;Tables have some very particular default styles—they’re one of the few elements that get borders by default. But if you don’t like the look, don’t worry, you can still customize their appearance as much as every other element! There are also a few properties useful for tables that you might not use elsewhere, such as &lt;code&gt;border-collapse&lt;/code&gt; and &lt;code&gt;vertical-align&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pseudo-selectors
&lt;/h3&gt;

&lt;p&gt;Pseudo-selectors are extra keywords that get added on to the end of a CSS selector, and they let us get more specific about what we’re selecting. Some of them select an element based on its &lt;em&gt;context&lt;/em&gt; instead of just what it is, while other ones give us access to things that can’t be targeted by normal selectors.&lt;/p&gt;

&lt;p&gt;The term pseudo-selector refers both to &lt;em&gt;pseudo-elements&lt;/em&gt; like &lt;code&gt;::before&lt;/code&gt; and &lt;code&gt;::after&lt;/code&gt;, and &lt;em&gt;pseudo-classes&lt;/em&gt; like &lt;code&gt;:first-of-type&lt;/code&gt;. Pseudo-classes are written with one colon (&lt;code&gt;:&lt;/code&gt;) and pseudo-elements are written with two colons (&lt;code&gt;::&lt;/code&gt;). &lt;/p&gt;

&lt;p&gt;Pseudo-classes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The selector &lt;code&gt;h2:first-of-type&lt;/code&gt; targets only the first &lt;code&gt;h2&lt;/code&gt; element on the page. Likewise, add the  &lt;code&gt;:last-of-type&lt;/code&gt; pseudo-selector on to the end of a type selector to target only the last instance of that element. Or &lt;code&gt;:nth-of-type()&lt;/code&gt; with a number between the parentheses to target only the 5th or 20th or whatever element of that type.&lt;/li&gt;
&lt;li&gt;Note that we mean “first” and “last” based on what order the tags are written in the HTML file, not where they visually display on the page—if you put some elements inside a flexbox set to reverse order, it does &lt;em&gt;not&lt;/em&gt; reverse what order they’re counted in.&lt;/li&gt;
&lt;li&gt;It’s not just for h2s of course! Selectors like &lt;code&gt;:first-of-type&lt;/code&gt; can be added to pretty much any type selector.&lt;/li&gt;
&lt;li&gt;The advantage of using these selectors instead of an ID selector (with the ID of the first h2, for instance) is that, if you edit the HTML later and rearrange the order of h2s, you won’t need to update the CSS to make it still keep selecting whichever one comes first.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:not()&lt;/code&gt; is a special pseudo-selector that selects the &lt;em&gt;inverse&lt;/em&gt; of another selector that you write between the parentheses. In the balance sheet, we used the selector &lt;code&gt;span:not(.sr-only)&lt;/code&gt; to target every span &lt;em&gt;except&lt;/em&gt; the ones with class &lt;code&gt;sr-only&lt;/code&gt;. Notice how we still use the &lt;code&gt;.&lt;/code&gt; syntax for the class selector inside the parentheses.&lt;/li&gt;
&lt;li&gt;Remember using &lt;code&gt;a:hover&lt;/code&gt; or &lt;code&gt;a:visited&lt;/code&gt; in past lessons to change how links look when the user hovers over them or after they’ve been clicked? These were pseudo-classes all along! you can add the &lt;code&gt;:hover&lt;/code&gt; pseudo-class to many other elements too, not just links.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Pseudo-Elements&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There weren’t any pseudo-elements in the balance sheet lesson, but we actually saw &lt;code&gt;::before&lt;/code&gt; in the accessibility lesson and &lt;code&gt;::after&lt;/code&gt; way back in the flexbox lesson. These are called pseudo-element selectors because they create a “fake” child element at either the start or end of the targeted element. They’re often used with the &lt;code&gt;content&lt;/code&gt; property. For example, in the quiz, we programmatically added the word “question” before each question number by writing this CSS rule:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nd"&gt;::before&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"Question #"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Instead of using these pseudo-elements to add text content, we can also use them to draw shapes, similar to how we’ve used divs. The piano lesson used this method with the &lt;code&gt;::after&lt;/code&gt; pseudo-element to draw the black keys onto the piano as a “pseudo child” of certain white keys. When you use it this way, just remember to include &lt;code&gt;content: ""&lt;/code&gt;, or else the pseudo-element won’t display at all.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are many, many more pseudo-selectors that we haven’t seen yet! To learn more, check out &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements" rel="noopener noreferrer"&gt;MDN’s pseudo-selector overview&lt;/a&gt; or, to find out what all the possibilities are, the full &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes" rel="noopener noreferrer"&gt;pseudo-classes documentation&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements" rel="noopener noreferrer"&gt;pseudo-elements documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Position
&lt;/h3&gt;

&lt;p&gt;In the Picasso lesson, we used the &lt;code&gt;position&lt;/code&gt; property to help us arrange elements at very specific distances relative to one another. It’s especially useful for doing CSS art like that, but it can also be applied in creating regular page layouts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;position: absolute&lt;/code&gt; removes an element from the &lt;em&gt;normal document flow&lt;/em&gt;, or in other words, takes it out of the place where it would normally sit in the page and doesn’t reserve space for it. Instead, it positions the element a certain distance away from a container, ignoring the size of the other content around it and letting it layer on top of the “normal” elements.&lt;/li&gt;
&lt;li&gt;In some cases, absolute position won’t work until you also specify a value for at least one of the &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;bottom&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt;, or &lt;code&gt;right&lt;/code&gt; properties. These tell the absolute item how far away to be from whichever side you pick.&lt;/li&gt;
&lt;li&gt;That “container” that these distances are calculated in relation to will be the nearest ancestor (parent, or parent of a parent, etc) that has &lt;code&gt;position: absolute&lt;/code&gt; or &lt;code&gt;position: relative&lt;/code&gt;. If none is assigned, then the container will be the body element. In the balance sheet, we gave the &lt;code&gt;table&lt;/code&gt; elements &lt;code&gt;position: relative&lt;/code&gt; so that it would act as a positioning container for the &lt;code&gt;caption&lt;/code&gt; element that we wanted to absolutely position 0.5rem in from its left edge.&lt;/li&gt;
&lt;li&gt;We also used &lt;code&gt;position: fixed&lt;/code&gt; in the quiz lesson to make the header remain fixed to the top of the page, so that it remained visible even when scrolling down. We did almost the same thing in the balance sheet, setting the years heading to stay at the top of the page when you scroll down past it, but in that one we used &lt;code&gt;position: sticky&lt;/code&gt; instead. The difference is that &lt;code&gt;sticky&lt;/code&gt; reserves space for the element in the normal document flow, whereas &lt;code&gt;fixed&lt;/code&gt; completely removes it into its own layer. In my personal opinion, &lt;code&gt;sticky&lt;/code&gt; is usually better for stuff like headers, because it doesn’t leave a gap in the document flow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Position can be pretty confusing, and it definitely makes more sense with visuals, so check out these two short YouTube videos:  a &lt;a href="https://www.youtube.com/watch?v=P6UgYq3J3Qs" rel="noopener noreferrer"&gt;video from the great Kevin Powell explaining absolute position&lt;/a&gt; that helped me in the past, and a &lt;a href="https://www.youtube.com/watch?v=P6UgYq3J3Qs0" rel="noopener noreferrer"&gt;video from Slaying the Dragon that goes over all five position types&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Z-index
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;z-index&lt;/code&gt; property determines how elements layer on top of each other. Elements with higher values of &lt;code&gt;z-index&lt;/code&gt; are drawn on top of (or closer to the front than) ones with a lower z-index. &lt;/p&gt;

&lt;p&gt;In the Picasso lesson, we used a negative z-index to put the back wall behind everything else, and then we used different positive values to arrange parts of the scene on top of each other, like making the table go in front of the characters.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Elements where we don’t set the &lt;code&gt;z-index&lt;/code&gt; property are equivalent to z-index of 0.&lt;/li&gt;
&lt;li&gt;As we saw in the Picasso lesson, changing the Z-index is most often used in combination with absolute positioning.&lt;/li&gt;
&lt;li&gt;Z-index doesn’t work on elements that have the default &lt;code&gt;position&lt;/code&gt; type of &lt;code&gt;static&lt;/code&gt;. If you want to use z-index but otherwise don’t need to change the element’s position, give it a position of &lt;code&gt;relative&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Media queries (responsiveness)
&lt;/h3&gt;

&lt;p&gt;Media queries were properly introduced in the piano lesson, but we actually saw them once or twice beforehand as well. The basic idea is that they allow your CSS to &lt;em&gt;respond differently&lt;/em&gt; when your website is viewed in different contexts (AKA on different media), which is why we call this &lt;em&gt;responsive design&lt;/em&gt;. The topic is actually much broader than freeCodeCamp has shown us, so you may want to &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Media_queries" rel="noopener noreferrer"&gt;read more about them on MDN&lt;/a&gt; if you’re curious.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Media queries use a slightly different syntax than anything else we’ve seen in CSS so far. It’s a type of &lt;em&gt;at-rule&lt;/em&gt;, meaning that it uses a keyword with an at symbol &lt;code&gt;@&lt;/code&gt; in front. They look like this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;800px&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Notice how there’s more than one selector and rule set nested inside the media query! You can think of it almost like an entire mini CSS file wrapped inside of the query. You can write as many different rule sets for different selectors as you want, all within the same media query, and you can use all the same selectors as usual.&lt;/li&gt;
&lt;li&gt;The statement inside the parentheses in the first line is the condition for when this entire set of styles should be applied. In this example, when the viewport is 800px wide or smaller, then this set of rules will be applied. When the viewport is larger than the rule’s max width, then these styles will be ignored.&lt;/li&gt;
&lt;li&gt;It’s possible to combine more than one condition. For example, to make an intermediate size for the piano, we used the media query &lt;code&gt;@media (max-width: 1199px) and (min-width: 769px)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;If you’re using a media query to override styles that you declared elsewhere in the file, then make sure that you put the media query &lt;em&gt;after&lt;/em&gt; them! When you’re using a min or max screen size rule to make a responsive layout (as you often will), it’s a good habit to always put this media query at the very bottom of your file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Odds and ends
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;aspect-ratio&lt;/code&gt; is a property that sets the ratio of the width and height. It’s useful when we want to make sure an image doesn’t get distorted when it gets resized.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;max()&lt;/code&gt; and &lt;code&gt;min()&lt;/code&gt; are two CSS functions that can take two measurements and choose whichever one is larger or smaller. This is most useful when one of the measurements is in relative units, where its actual size might vary. For example, &lt;code&gt;font-size: min(5vw, 1.2em);&lt;/code&gt; will set the font size to be whichever of &lt;code&gt;5vw&lt;/code&gt; and &lt;code&gt;1.2em&lt;/code&gt; is smaller—and which one is smaller will change depending on the viewport size.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;calc()&lt;/code&gt; is a CSS function that lets you do some math and calculate a value dynamically. For example, &lt;code&gt;width: calc(100% - 20px);&lt;/code&gt; will make the width 20px less than whatever the parent’s width is, and it will update and recalculate any time the parent’s width changes. You can also use it for static values like &lt;code&gt;calc(350px - 78px)&lt;/code&gt; if you just don’t want to do the math yourself! But it really comes in most handy when you’re trying to do math between two different units.&lt;/li&gt;
&lt;li&gt;You can use the &lt;code&gt;!important&lt;/code&gt; keyword to protect a rule from being overwritten by any others. Just add the word to the end of the declaration right before the semicolon, as in &lt;code&gt;border: 0 !important;&lt;/code&gt;. However, it’s best to avoid relying on this keyword because it makes the code harder to read and understand later. Often, you can prevent clashes just by making your selectors more precise instead.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;That was a lot (I think these posts might be getting longer each week, whoops), but I hope it’s starting to sink in bit by bit! It’s okay if things still feel confusing right now. We’re learning so much and I’m so proud of everyone who’s participating in this bootcamp! I love all the work I’ve seen so far from those of you who have shared your projects, too! I would be thrilled to see more of you share your work on the &lt;a href="https://discord.gg/pySW9YZfYY" rel="noopener noreferrer"&gt;Bad Website Club Discord&lt;/a&gt; or the &lt;a href="https://forum.freecodecamp.org/c/2023-webdev-bootcamp/586" rel="noopener noreferrer"&gt;forum&lt;/a&gt;—or, if you’re feeling stuck with your project, use those places to reach out and talk about what you’re struggling with.&lt;/p&gt;

&lt;p&gt;As always, you’re more than welcome to leave any questions in the comments below, as well as asking on Discord and the forum. Take care until next time!&lt;/p&gt;

&lt;p&gt;Cover art by &lt;a href="https://ecasticx.com/" rel="noopener noreferrer"&gt;Kiri&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
      <category>freecodecamp</category>
    </item>
    <item>
      <title>BWC Bootcamp Recap: Week 2</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Tue, 15 Aug 2023 19:45:13 +0000</pubDate>
      <link>https://dev.to/caesiumtea/bwc-bootcamp-recap-week-2-4ge3</link>
      <guid>https://dev.to/caesiumtea/bwc-bootcamp-recap-week-2-4ge3</guid>
      <description>&lt;p&gt;Congratulations, friends and learners, on completing week 2 of Bad Website Club’s &lt;a href="https://badwebsite.club/webdev-bootcamp-2023.html" rel="noopener noreferrer"&gt;free web dev bootcamp&lt;/a&gt;! Here’s your weekly recap of the major topics we’ve covered.&lt;/p&gt;

&lt;p&gt;Also check out week 2’s extra post, a &lt;a href="https://dev.to/caesiumtea/bwc-bootcamp-recap-css-selectors-2efn"&gt;review of CSS selectors&lt;/a&gt;! They’ll come in handy as you continue your CSS journey.&lt;/p&gt;

&lt;p&gt;Before we start, here are some review questions. Once again, I strongly encourage you to try your best to answer each one before moving on—and remember, the important part isn’t whether you get them correct, the important part is just to exercise your memory by attempting it!&lt;/p&gt;

&lt;h2&gt;
  
  
  Quiz yourself!
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What’s the difference between margin and padding?&lt;/li&gt;
&lt;li&gt;What’s the semantic meaning of a &lt;code&gt;span&lt;/code&gt; element?&lt;/li&gt;
&lt;li&gt;Which property would you use to turn an element into a flex container?&lt;/li&gt;
&lt;li&gt;If you have a flex container with a &lt;code&gt;flex-direction&lt;/code&gt; of &lt;code&gt;row&lt;/code&gt;, which property can you use to vertically center the flex items within the container? (PS: this is a hard one—it’s okay to not have this memorized, you can always just look it up when you need it!)&lt;/li&gt;
&lt;li&gt;What’s one way we learned to make the text on your page more readable? &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The box model (Rothko painting lesson)
&lt;/h3&gt;

&lt;p&gt;The term ”box model” refers to the “conceptual rectangles” that surround every HTML element. It’s almost like layers of an onion.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x22nqonsslw0gvvkmfk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x22nqonsslw0gvvkmfk.png" alt="Diagram of the CSS box model. There's a box labeled content in the middle, a box around it labeled padding, a rectangle labeled border, and finally the outside area is labeled margin." width="500" height="394"&gt;&lt;/a&gt;&lt;br&gt;
(Image from &lt;a href="https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-the-css-box-model-by-building-a-rothko-painting/step-5" rel="noopener noreferrer"&gt;freeCodeCamp&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;At the center, there’s the content box—the size of the element itself. The next layer out is the padding box, which is empty space inside the border of an element. Next comes the border box, which accounts for the thickness of any border you set. And last is the margin box, which is space outside the border that pushes elements away from one another. You typically won’t &lt;em&gt;see&lt;/em&gt; all of these boxes on every element, because some of them will often be set to 0 thickness.&lt;/p&gt;

&lt;p&gt;When you don’t use CSS to specify the size of margin, border, and padding, the web browser will apply its own default values. These defaults vary from one browser to another. Therefore, it’s very helpful to specify your own values for the box model properties.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;box-sizing&lt;/code&gt; property controls how an element’s &lt;code&gt;height&lt;/code&gt; and &lt;code&gt;width&lt;/code&gt; are counted. The default value is &lt;code&gt;content-box&lt;/code&gt;. Under this setting, if you give an element &lt;code&gt;width: 100px&lt;/code&gt;, then the content box will be 100px wide and any borders or padding will be &lt;em&gt;added on top of&lt;/em&gt; that 100px, making the overall element bigger than 100px. The alternative is &lt;code&gt;border-box&lt;/code&gt;, which includes the border and the padding as part of the width and height. If you have that 100px-wide element set to &lt;code&gt;box-sizing: border-box&lt;/code&gt;, and it has some thickness of border and padding applied, then the outer edges of the &lt;em&gt;border&lt;/em&gt; will measure 100px wide, and the content box will get &lt;em&gt;smaller&lt;/em&gt; than 100px. I think this is best understood by just playing around with it yourself!&lt;/p&gt;

&lt;p&gt;We learned another important lesson during the Rothko exercise: Vertical margins behave in unexpected ways sometimes! Recall that at one point, we tried adding some margin to one of the rectangles in the painting, but it ended up pushing the whole canvas down instead of just pushing the rectangle down. This was due to a phenomenon called &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing" rel="noopener noreferrer"&gt;margin collapse&lt;/a&gt;. It happens when the margin of one element extends out through the margin of its parent element. freeCodeCamp said the solution was to give the rectangle something “solid” to push against, so we added some padding to the canvas (the parent of the rectangle), and then the margins started behaving as expected. (Padding and borders are examples of “something solid.”)&lt;/p&gt;

&lt;p&gt;To avoid this problem, if you want to put space between a child element and its parent, then it’s better to apply padding to the parent instead of applying margin to the child.&lt;/p&gt;

&lt;p&gt;Margin collapse is pretty complicated, and I don’t recommend worrying about all the details of it while you’re still learning the basics of CSS. It’s just helpful to know that, if you ever see that your vertical spacing is coming out different than you expected and you can’t find where your mistake was, it might not be a mistake after all. And whenever that happens, one possible solution is to try using padding instead of margin.&lt;/p&gt;

&lt;h3&gt;
  
  
  Flexbox (cat photo gallery lesson)
&lt;/h3&gt;

&lt;p&gt;Flexbox is a simple way to arrange items on the page. You apply &lt;code&gt;display: flex&lt;/code&gt; on a parent element to make it into a &lt;em&gt;flex container&lt;/em&gt;, and then all its direct child elements become &lt;em&gt;flex items&lt;/em&gt;. The flex items get neatly distributed across the flex container. You can choose to arrange the flex items in either a row or a column. &lt;/p&gt;

&lt;p&gt;One tricky thing about flexbox is that we don’t talk about the lines being horizontal or vertical. Instead, the direction that the row or column follows is called the main axis, and the perpendicular direction is called the cross axis. Properties like &lt;code&gt;justify-content&lt;/code&gt; and &lt;code&gt;align-items&lt;/code&gt; will give different results depending on whether the main axis is a row or column. (”Justify” properties refer to the main axis alignment, and “align” properties refer to the cross axis alignment.)&lt;/p&gt;

&lt;p&gt;Flexbox creates a &lt;em&gt;one-dimensional&lt;/em&gt; layout: it takes all the child elements of the flex container and arranges them in a line, and then if the line is too long to fit in the container, it can optionally wrap down onto multiple lines. It’s important to remember that, even when it ends up wrapping into multiple lines and making a layout that &lt;em&gt;appears&lt;/em&gt; to have rows and columns, it’s still &lt;em&gt;behaving&lt;/em&gt; as just a single line. Think of your flexbox content more like a line of text: like a long sentence, it just wraps around to the next line when it reaches the end of the page. &lt;/p&gt;

&lt;p&gt;(But what if you do want to control your layout in rows and columns instead? Later in the course we’ll learn about CSS grid, which solves that problem!)&lt;/p&gt;

&lt;p&gt;In the “learn accessibility by building a quiz” lesson, we saw flexbox used to space out the links in the navigation bar. This is a very common use case! Flexbox makes it super easy to space things out in consistent intervals, and it’s extra handy for lists (like navigation menus) because it adapts to the user’s text direction. If someone translated our quiz page into a right-to-left language like Arabic, flexbox would automatically put the first link on the right instead of the left. &lt;/p&gt;

&lt;p&gt;A really great way to learn more about flexbox is to play this super cute interactive game called &lt;a href="https://flexboxfroggy.com/" rel="noopener noreferrer"&gt;Flexbox Froggy&lt;/a&gt;! It really helps with visualizing what the different properties mean.&lt;/p&gt;

&lt;p&gt;There’s also a great &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;visual guide to flexbox from CSS Tricks&lt;/a&gt;, which I often use as a reference to figure out which properties I need to get the layout I want. (Remember that it’s totally okay to use references while you’re building websites, you don’t need to memorize everything!)&lt;/p&gt;

&lt;h3&gt;
  
  
  Typography (nutrition label lesson)
&lt;/h3&gt;

&lt;p&gt;There were really not any major new concepts in this lesson! Instead, we put together many of the skills we already learned to demonstrate how finely we can control the appearance of our text.&lt;/p&gt;

&lt;p&gt;We did meet the &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt; element for the first time, though! This element is mainly used for styling a short &lt;em&gt;span of text&lt;/em&gt;, and often used inside of other text elements like &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;. It’s an &lt;em&gt;inline element&lt;/em&gt;, unlike &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, which is a &lt;em&gt;block element.&lt;/em&gt; (Remember that a block element takes up the full width of its parent, but an inline element can fit in the same line with others.)&lt;/p&gt;

&lt;p&gt;I also want to draw attention to one subtler part of the lesson: the way we used two complementary approaches to making classes.  &lt;/p&gt;

&lt;p&gt;In most of our lessons so far, we’ve created classes that correspond to specific kinds of elements. For example, in the cafe menu lesson we had a class for coffee flavors and a class for prices, and in the colored markers lesson, each marker had its own class. The CSS rules for those classes had a list of several properties that were &lt;em&gt;visually&lt;/em&gt; unrelated, but instead grouped together by the &lt;em&gt;semantic purpose&lt;/em&gt; of the class—like, “all the styles needed to make this look like a green marker.” &lt;/p&gt;

&lt;p&gt;We still used this approach a little bit in the nutrition label lesson, like when we made the class &lt;code&gt;calories-info&lt;/code&gt; to give unique styles to that one part of the label, based on its content. But most of the classes that we wrote for the nutrition label were &lt;em&gt;not&lt;/em&gt; tied to their content like this.&lt;/p&gt;

&lt;p&gt;Instead, many of the classes had names like &lt;code&gt;bold&lt;/code&gt;, &lt;code&gt;indent&lt;/code&gt;, or &lt;code&gt;sm-text&lt;/code&gt;. They didn’t refer to what the content of those elements would be; instead they were &lt;em&gt;reusable&lt;/em&gt; classes that held a set of &lt;em&gt;visually related&lt;/em&gt; properties, and we applied them to many different elements throughout the label. This approach might be described with terms like “utility classes” or “functional CSS”.&lt;/p&gt;

&lt;p&gt;When you’re planning out how to write your CSS, it can be useful to think about how styles might need to get repeated across your project. Sometimes it’s most efficient to create “semantic” classes like &lt;code&gt;calories-info&lt;/code&gt; that refer to what their content is, and group together several styles at once. Other times, like if you have many different elements that need bold text but might have different sizes, then maybe it would be more efficient to write a more generic &lt;code&gt;bold-text&lt;/code&gt; class and apply it to all those different kinds of elements, so that you can write out the &lt;code&gt;font-weight&lt;/code&gt; property just once instead of needing to add that line into several different classes. &lt;/p&gt;

&lt;p&gt;It’s also helpful to think about how you might want to change your CSS in the future, and how to write classes in a way that makes it easier to change things. For example, if you decided that you want all your bold text to have &lt;code&gt;font-weight: 900&lt;/code&gt; instead of &lt;code&gt;font-weight: 800&lt;/code&gt;, the using one single &lt;code&gt;bold-text&lt;/code&gt; class would mean you only need to update that value in one place.&lt;/p&gt;

&lt;p&gt;There’s no right or wrong approach here, though! You don’t have to overthink it, just organize your CSS in whatever way makes sense to you. &lt;/p&gt;

&lt;h3&gt;
  
  
  Odds and ends
&lt;/h3&gt;

&lt;p&gt;A few smaller things that were scattered throughout this week’s lessons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To restore a CSS property to its default value (as if you never had mentioned it), use the value &lt;code&gt;unset&lt;/code&gt;. For example, &lt;code&gt;margin: unset;&lt;/code&gt; will apply the default margin set by the browser. This is useful if you want to apply a CSS rule to a large group of elements, but then have just one specific element where you want to “undo” that rule.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Relatedly, remember that CSS rules generally get applied in order from top to bottom of the CSS file—so if you’re doing that “general rule then a more specific rule to override it” thing, make sure the more specific one comes later in the file!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the Rothko painting lesson, we learned some fun ways to make our “conceptual rectangles” a little less rectangular. The &lt;code&gt;border-radius&lt;/code&gt; property rounds the corners of an element. &lt;code&gt;filter: blur()&lt;/code&gt; creates a fuzzy, blurry effect, and &lt;code&gt;transform: rotate()&lt;/code&gt; changes what angle the rectangle sits at. Try looking up these properties and functions on MDN for more info and examples!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;object-fit&lt;/code&gt; property changes the way an image fits into its rectangle, and particularly, what happens when the rectangle gets squished—like we saw happen when images are put into a flexbox container with no wrap. By default, the image will get stretched and warped, but if we set &lt;code&gt;object-fit: cover&lt;/code&gt; then it will maintain its aspect ratio and get &lt;em&gt;cropped&lt;/em&gt; to fit instead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The flexbox lesson showed us the &lt;em&gt;pseudo-element&lt;/em&gt; &lt;code&gt;::after&lt;/code&gt;. (We’ll talk more about pseudo-elements later!) We used the selector &lt;code&gt;.container::after&lt;/code&gt; to create a new, empty element as the last child of the element with the class &lt;code&gt;container&lt;/code&gt; . Take a second to think about how wild that is! Normally, it’s the job of HTML to create all of the content and the job of CSS just to style it, but this is an exception where CSS is actually creating a new object on the page! It’s a big power that comes with big responsibility. Since it kind of breaks the rules about the roles of HTML and CSS, we need to be careful about how we use it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Next week
&lt;/h3&gt;

&lt;p&gt;Since we only got part of the way through the accessibility lesson, I’ll recap that one as part of week 3. We have some fun new topics to look forward to in week 3, too: tables, pseudo-selectors, more CSS art, and finally, how to make our pages &lt;em&gt;responsive&lt;/em&gt; to different screen sizes! &lt;/p&gt;

&lt;p&gt;I hope you’re getting more comfortable with CSS and HTML by now! How are your projects coming along? I’m looking forward to seeing what you all create!&lt;/p&gt;

&lt;p&gt;As always, if you have questions about this material or if there’s anything else that you struggled with from week 2, please do leave a comment on this post, or ask a question in the &lt;a href="https://discord.gg/pySW9YZfYY" rel="noopener noreferrer"&gt;Bad Website Club Discord&lt;/a&gt; or the &lt;a href="https://forum.freecodecamp.org/c/2023-webdev-bootcamp/586" rel="noopener noreferrer"&gt;freeCodeCamp forum&lt;/a&gt;! Take care, friends!&lt;/p&gt;

&lt;h2&gt;
  
  
  Quiz answers
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Margin is the empty space &lt;em&gt;around&lt;/em&gt; an element. Padding is empty space &lt;em&gt;inside&lt;/em&gt; the element.&lt;/li&gt;
&lt;li&gt;Trick question! Span is sort of like the inline equivalent of div—it doesn’t have any semantic meaning and it’s mainly used for applying styles to a particular chunk of text.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;display: flex;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;align-items: center;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;One method that we learned in the Typography lessons is to use margin and padding to create space between different text items. There are surely others too! Like making sure there’s enough contrast between the text color and background color, or choosing legible fonts.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cover art by &lt;a href="https://ecasticx.com/" rel="noopener noreferrer"&gt;Kiri&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>freecodecamp</category>
      <category>flexbox</category>
      <category>css</category>
    </item>
    <item>
      <title>BWC Bootcamp Recap: CSS Selectors</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Thu, 10 Aug 2023 06:01:33 +0000</pubDate>
      <link>https://dev.to/caesiumtea/bwc-bootcamp-recap-css-selectors-2efn</link>
      <guid>https://dev.to/caesiumtea/bwc-bootcamp-recap-css-selectors-2efn</guid>
      <description>&lt;p&gt;Hello friends and learners, great job making it to week 2 of Bad Website Club’s &lt;a href="https://badwebsite.club/webdev-bootcamp-2023.html" rel="noopener noreferrer"&gt;free web dev bootcamp&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;We’ve seen a handful of different CSS selectors in our lessons so far. It can be tricky to remember what all of them do and why you would want to use them, so let’s review!&lt;/p&gt;

&lt;p&gt;Reminder: the CSS &lt;em&gt;selector&lt;/em&gt; is what we call the part that comes before the curly braces &lt;code&gt;{ }&lt;/code&gt; in a CSS rule. The selector determines which HTML elements the rule will apply to. &lt;/p&gt;

&lt;h2&gt;
  
  
  Basic selectors
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Type selector (&lt;code&gt;type&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is simplest selector we have! All you write is the name of the tag that you want to style, and then the rule will apply to &lt;em&gt;every element of that type&lt;/em&gt;. Use this if you want to set the font size for all of your &lt;code&gt;h2&lt;/code&gt; elements at the same time, for example.&lt;/p&gt;

&lt;h3&gt;
  
  
  ID selector (&lt;code&gt;#id&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS file */&lt;/span&gt;

&lt;span class="nf"&gt;#title&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;3rem&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nf"&gt;#red-marker&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="c"&gt;/* HTML file */&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"title"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;Bad&lt;/span&gt; &lt;span class="nt"&gt;Website&lt;/span&gt; &lt;span class="nt"&gt;Club&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"red-marker"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the other hand, maybe you want to give unique styles to just one single element. In that case, you can use the ID selector. Make sure to assign some value to the element’s &lt;code&gt;id&lt;/code&gt; attribute in your HTML file. Then, you can write the selector by putting a hashtag/number sign &lt;code&gt;#&lt;/code&gt; directly before the value of &lt;code&gt;id&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is most useful for styles that you know you will only want to apply one time, styles that are uniquely related to one single element. It’s especially useful when you have several elements of the same type but want each one of them to have a different style.&lt;/p&gt;

&lt;p&gt;In the “colored markers” freeCodeCamp lesson, we gave each marker its own class and used that class to set the different colors for each marker. But since we knew there would only be one marker of each color, another option would have been to give each marker an &lt;code&gt;id&lt;/code&gt; and assign the color to that ID, instead of using classes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Class selector (&lt;code&gt;.class&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS file */&lt;/span&gt;

&lt;span class="nc"&gt;.large-text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;1.5em&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nc"&gt;.blue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nc"&gt;.canvas&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="c"&gt;/* HTML file */&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"large-text blue"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;I&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nt"&gt;m&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="nt"&gt;big&lt;/span&gt; &lt;span class="nt"&gt;blue&lt;/span&gt; &lt;span class="nt"&gt;paragraph&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"canvas"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This might be the selector we use the most often. It targets all of the elements on your page that have a certain &lt;code&gt;class&lt;/code&gt; attribute. Write this selector by typing a period &lt;code&gt;.&lt;/code&gt; right before the name of the class.&lt;/p&gt;

&lt;p&gt;This is very versatile because you can manually pick and choose which elements will be part of your class. It’s especially useful when you have a group of similar elements that you want to share a style, but don’t want to give that style to &lt;em&gt;all&lt;/em&gt; elements of the same time. Note the &lt;code&gt;blue&lt;/code&gt; and &lt;code&gt;large-text&lt;/code&gt; classes in the example above. We might set up our classes this way if we wanted paragraphs with a certain type of information to use larger text, or wanted only a subset of heading elements to be blue. We don’t want to apply those styles to &lt;em&gt;every&lt;/em&gt; paragraph or heading, just to the ones we chose by giving them the right class attribute.&lt;/p&gt;

&lt;p&gt;Remember that the class selector won’t actually do anything until you assign the class to some elements! Make sure to go to your HTML file and write &lt;code&gt;class="whatever-your-class-is-called"&lt;/code&gt; inside the opening tag of every element that you want to apply this set of styles to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Universal selector (&lt;code&gt;*&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nl"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The universal selector is typed as just the asterisk symbol &lt;code&gt;*&lt;/code&gt; by itself. It selects &lt;em&gt;every single element&lt;/em&gt; on the page. &lt;/p&gt;

&lt;p&gt;It’s often used to do what people call a “CSS reset” or “normalizing the CSS”. This means setting certain properties (often including &lt;code&gt;box-sizing&lt;/code&gt;, &lt;code&gt;margin&lt;/code&gt;, or &lt;code&gt;padding&lt;/code&gt;) to be the same on every element in order to override the default values set by the web browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  Attribute selector (&lt;code&gt;[attr]&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS file */&lt;/span&gt;
&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"number"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;50%&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;input&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;required&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;*=&lt;/span&gt;&lt;span class="s1"&gt;"blue"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="c"&gt;/* HTML file */&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"number"&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"input-number-blue"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"text"&lt;/span&gt; &lt;span class="nt"&gt;required&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"blue-marker"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Attribute selectors can be a little more complex than the others we’ve seen so far. There are a few different ways to use them, but the basic idea is that you’re choosing which elements to apply your rule to based on what HTML attributes they have.  (Remember, attributes are those extra words inside the opening tag.) &lt;/p&gt;

&lt;p&gt;Attribute selectors are written with square brackets &lt;code&gt;[ ]&lt;/code&gt; around the attribute name (and value, if there is one). If you want to select anything that has the attribute set at all, regardless of its value, then type only the attribute name inside the brackets. On the other hand, if you want to select elements based on the &lt;em&gt;value&lt;/em&gt; of an attribute, then copy and paste the entire attribute-value pair (both sides of the equals sign &lt;code&gt;=&lt;/code&gt;) from the HTML tag into the brackets of the CSS selector.&lt;/p&gt;

&lt;p&gt;If you want to target elements of &lt;em&gt;any type&lt;/em&gt; that have a certain attribute, then the whole selector will be wrapped in square brackets. However, when we’re trying to target elements by an attribute, there’s often only a &lt;em&gt;single type&lt;/em&gt; that we want to include. In that case, we can narrow down the selection by writing a type name directly before the opening bracket.&lt;/p&gt;

&lt;p&gt;Let’s walk through the examples above.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;input[type="number"]&lt;/code&gt; selects any element that &lt;em&gt;a)&lt;/em&gt; is a tag of the type &lt;code&gt;input&lt;/code&gt;, and also &lt;em&gt;b)&lt;/em&gt; has a &lt;code&gt;type&lt;/code&gt; attribute assigned with the value of &lt;code&gt;number&lt;/code&gt;. It will select only the first input in this example.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;input[required]&lt;/code&gt; selects any element that a) is of the type &lt;code&gt;input&lt;/code&gt;, and b) has the &lt;code&gt;required&lt;/code&gt; attribute included somewhere in its opening tag. It will select the second input element in the example HTML.
This is a case where you don’t need to use the = sign to specify a value. (But it’s not &lt;em&gt;just&lt;/em&gt; because the &lt;code&gt;required&lt;/code&gt; attribute never has a value attached! &lt;code&gt;input[type]&lt;/code&gt; would be an equally valid selector, and would select all input elements that have &lt;em&gt;any value&lt;/em&gt; of &lt;code&gt;type&lt;/code&gt; assigned. I just couldn’t think of any other attribute that you realistically would have a &lt;em&gt;reason&lt;/em&gt; to select without a certain value!)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[id*="blue"]&lt;/code&gt; is a little weirder! It selects any element of &lt;em&gt;any type&lt;/em&gt; that has an &lt;code&gt;id&lt;/code&gt; attribute with the word &lt;code&gt;blue&lt;/code&gt; somewhere in its value. In the example HTML, it would select &lt;em&gt;both&lt;/em&gt; the first input (with ID &lt;code&gt;input-number-blue&lt;/code&gt;) and the div with ID &lt;code&gt;blue-marker&lt;/code&gt;.
The reason it selects elements of all types is because we didn’t include a type name before the brackets. Also, notice how it’s not just an equals sign, it’s &lt;code&gt;*=&lt;/code&gt; (asterisk equals). This symbol is what makes it search for IDs that &lt;em&gt;contain&lt;/em&gt; the letters “blue” anywhere in them, whereas writing just &lt;code&gt;id=blue&lt;/code&gt; would search for IDs that &lt;em&gt;exactly equal&lt;/em&gt; “blue”.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are several different kinds of syntax available to search for &lt;em&gt;sub-strings&lt;/em&gt; (partial matches) of the value. You can read more about all the options on &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors" rel="noopener noreferrer"&gt;MDN’s “Attribute selectors” page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I used inputs as an example here because this is a common situation where you might want to style elements differently depending on one of their attributes. Otherwise, attributes &lt;em&gt;usually&lt;/em&gt; don’t have a close relation to CSS properties. &lt;/p&gt;

&lt;h2&gt;
  
  
  Combining selectors
&lt;/h2&gt;

&lt;p&gt;We can also write more complex CSS selectors that &lt;em&gt;combine&lt;/em&gt; two or more of the selectors described above. The special characters that we put in between the two different selectors are called &lt;em&gt;combinators&lt;/em&gt;. Using combinators to construct more complex selectors gives us more control to target elements that fall into very specific regions of the page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Descendant selector (&lt;code&gt;A B&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS file */&lt;/span&gt;

&lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;text-decoration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;500px&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;section&lt;/span&gt; &lt;span class="nc"&gt;.blue&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="c"&gt;/* HTML file */&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;home&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;about&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;gallery&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"blue"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;paragraph&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"blue"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;heading&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"blue"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;paragraph&lt;/span&gt; &lt;span class="err"&gt;2&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"blue"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;paragraph&lt;/span&gt; &lt;span class="err"&gt;3&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"green"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;paragraph&lt;/span&gt; &lt;span class="err"&gt;4&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;section&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;main&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The descendant selector has the simplest syntax: there’s no special symbol to type, just put a space between the two parts of the selector. This will target elements of the second type that are &lt;em&gt;descendants&lt;/em&gt; of an element of the first type—which means they’re nested anywhere inside. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The selector &lt;code&gt;nav a&lt;/code&gt; will target links that are found anywhere within a &lt;code&gt;nav&lt;/code&gt; element—they could be direct children of &lt;code&gt;nav&lt;/code&gt;, or they could be nested several levels deep, like the ones in the HTML above. This example is very commonly used: we often want links in the site’s navigation bar to look different than links found within the main body of text. 
It does &lt;em&gt;not&lt;/em&gt; target &lt;code&gt;nav&lt;/code&gt; itself.&lt;/li&gt;
&lt;li&gt;You can even repeat the same selector twice! &lt;code&gt;div div&lt;/code&gt; will target any &lt;code&gt;div&lt;/code&gt; element that is found &lt;em&gt;within another div&lt;/em&gt;. So if you had many nested divs, it would target all of them &lt;em&gt;except&lt;/em&gt; the outer-most one.&lt;/li&gt;
&lt;li&gt;They don’t have to be made up of just type selectors—any of the basic selectors we saw in the previous section of this post should work as parts of a descendant selector. So &lt;code&gt;section .blue&lt;/code&gt; will select any element that &lt;em&gt;a)&lt;/em&gt; has the class &lt;code&gt;blue&lt;/code&gt;, and &lt;em&gt;b)&lt;/em&gt; is found inside of a &lt;code&gt;section&lt;/code&gt; element. Looking at the HTML above, this selector would target heading 1, paragraph 2, and paragraph 3, but would &lt;em&gt;not&lt;/em&gt; target paragraph 1 (because it’s not inside a &lt;code&gt;section&lt;/code&gt;) or paragraph 4 (because it doesn’t have the class &lt;code&gt;blue&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Direct child selector (&lt;code&gt;A &amp;gt; B&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS file */&lt;/span&gt;

&lt;span class="nt"&gt;nav&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;ul&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;list-style-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="c"&gt;/* HTML file */&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;home&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;about&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;gallery&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;cat&lt;/span&gt; &lt;span class="nt"&gt;gallery&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;dog&lt;/span&gt; &lt;span class="nt"&gt;gallery&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The direct child selector is similar to the descendant selector, but narrower: it only targets children whose &lt;em&gt;immediate parent&lt;/em&gt; is the one named first. The combinator is the right angle bracket &lt;code&gt;&amp;gt;&lt;/code&gt; symbol, so it’s written like &lt;code&gt;selector1 &amp;gt; selector2&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In this example, &lt;code&gt;nav &amp;gt; ul&lt;/code&gt; will target the first list that contains the “home”, “about”, and “gallery” list items, but it will &lt;em&gt;not&lt;/em&gt; target the second &lt;code&gt;ul&lt;/code&gt; that says “cat gallery” and “dog gallery”.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adjacent sibling selector (&lt;code&gt;A + B&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="c"&gt;/* CSS file */&lt;/span&gt;

&lt;span class="nf"&gt;#home-button&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="c"&gt;/* HTML file */&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"home-button"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;home&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"about-button"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;about&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"gallery-button"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;gallery&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;nav&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of selecting elements based on their parent, the adjacent sibling selector targets elements based on another element that comes before them at the &lt;em&gt;same level&lt;/em&gt; of nesting. The combinator is the plus sign &lt;code&gt;+&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This selector only ever targets one single element: &lt;code&gt;#home-button + li&lt;/code&gt; only targets the &lt;em&gt;first&lt;/em&gt; list item that comes after &lt;code&gt;#home-button&lt;/code&gt;, and only if they share the same parent. There can’t be any other element between them. Note that we’re talking about what order the HTML tags are &lt;em&gt;written&lt;/em&gt; in, not how things are visually laid out on the page.&lt;/p&gt;

&lt;p&gt;We already said that the ID selector is what you should use if you’re trying to target just one single element, right, so why use this combinator instead? The advantage is that you can change around the HTML without needing to update the CSS when the order of the elements changes. In this example, we might be trying to give the home button some extra space by using the adjacent sibling selector to apply a bigger margin to whatever comes after it. Using the adjacent sibling selector means we don’t have to change the CSS at all if we decide to swap the places of the Gallery and About buttons. (This is not a great example because it would be more straightforward to just set the extra &lt;code&gt;margin-bottom&lt;/code&gt; on &lt;code&gt;#home-button&lt;/code&gt; rather than &lt;code&gt;margin-top&lt;/code&gt; on the thing next to it, but if for some reason you wanted to make the button next to home be a different color or something, that would also use this selector.)&lt;/p&gt;

&lt;h3&gt;
  
  
  General sibling selector (&lt;code&gt;A ~ B&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#home-button&lt;/span&gt; &lt;span class="o"&gt;~&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one is similar to the adjacent sibling selector, but more flexible. It can target an adjacent sibling &lt;em&gt;and&lt;/em&gt; any other siblings (elements sharing the same parent) that come further down in the HTML after it. The combinator is the tilde symbol &lt;code&gt;~&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Compare this example with the one from the adjacent sibling selector. The only difference in these two selectors is which combinator they use. Given the same HTML, this CSS rule would select &lt;em&gt;both&lt;/em&gt; the About list item and the Gallery list item. &lt;/p&gt;

&lt;p&gt;We could use this if we wanted every link in the nav aside from the first one to be green, for instance. &lt;/p&gt;

&lt;p&gt;See this &lt;a href="https://blog.logrocket.com/understanding-sibling-combinators-css/" rel="noopener noreferrer"&gt;blog post from LogRocket&lt;/a&gt; for more examples of reasons you might use the two different sibling selectors. (Warning: It’s on a website that’s trying to sell you stuff.)&lt;/p&gt;

&lt;h3&gt;
  
  
  Grouping (&lt;code&gt;A, B&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;h4&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;purple&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;

&lt;span class="nt"&gt;section&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;article&lt;/span&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;green&lt;/span&gt;&lt;span class="p"&gt;;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to apply the same style rule to various different kinds of elements, and there’s no one selector that applies to all of them, then you can just list different selectors separated by commas! It works with selectors that include combinators too.&lt;/p&gt;

&lt;h2&gt;
  
  
  More resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Here’s a really fun way to both recap the selectors we already know, and also learn some new ones: an interactive game called &lt;a href="https://flukeout.github.io/" rel="noopener noreferrer"&gt;CSS Diner&lt;/a&gt;! This is totally how I started to understand selectors.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors/Selectors_and_combinators" rel="noopener noreferrer"&gt;MDN guide to selectors and combinators&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://kittygiraudel.github.io/selectors-explained/" rel="noopener noreferrer"&gt;Selectors Explained&lt;/a&gt; translates a CSS selector into a plain English description.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>BWC Bootcamp Recap: Week 1</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Sat, 05 Aug 2023 16:24:57 +0000</pubDate>
      <link>https://dev.to/caesiumtea/bwc-bootcamp-week-1-recap-3c4f</link>
      <guid>https://dev.to/caesiumtea/bwc-bootcamp-week-1-recap-3c4f</guid>
      <description>&lt;p&gt;Hello learners, and congratulations on getting through the first week of the &lt;a href="https://badwebsite.club/webdev-bootcamp-2023.html" rel="noopener noreferrer"&gt;free webdev bootcamp&lt;/a&gt;! We’ve been going through a LOT of material very quickly—when I was a teenager I spent &lt;em&gt;months&lt;/em&gt; learning what we did here in a single week!—and it’s easy to get lost in all this new information. So at the end of every week, I’m going to be writing one of these posts to recap what we’ve learned together!&lt;/p&gt;

&lt;p&gt;But I’m going to follow in Jess’s footsteps and be a bit mean to you all: Before I give you my recap, each post will start off with some &lt;em&gt;questions&lt;/em&gt; to make you try to recap the lessons yourself! The purpose is to get you using a &lt;em&gt;super effective&lt;/em&gt; learning strategy called active recall. It’s A-okay if you don’t remember the answers—just the act of &lt;em&gt;trying&lt;/em&gt; to remember will strengthen your memory! I really encourage you to give each question an honest attempt before reading on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quiz yourself!
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;What’s the difference between HTML and CSS?&lt;/li&gt;
&lt;li&gt;What tag would you use to put a picture into a web page?&lt;/li&gt;
&lt;li&gt;What does it mean if an HTML tag is self-closing?&lt;/li&gt;
&lt;li&gt;What’s the difference between a block element and an inline element?&lt;/li&gt;
&lt;li&gt;If you want to add a style to every element in the class called “large-text”, what &lt;em&gt;CSS selector&lt;/em&gt; should you write?&lt;/li&gt;
&lt;li&gt;What elements belong inside the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; element?&lt;/li&gt;
&lt;li&gt;Name one way to make your website more &lt;em&gt;accessible&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;What’s wrong with this code? &lt;code&gt;&amp;lt;input type="textarea"&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Key concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;To code a web page, we need two languages, HTML and CSS. So far our websites have been made up of two files, &lt;code&gt;index.html&lt;/code&gt; and &lt;code&gt;styles.css&lt;/code&gt;. The HTML file is where we put the content of our page and give it structure, while the CSS file is where we put rules that describe the visual properties of that content. Each tag in the HTML file creates an &lt;em&gt;element&lt;/em&gt; in the web page. (You can also check out my &lt;a href="https://dev.to/caesiumtea/bwc-bootcamp-recap-html-and-css-vocabulary-41e4"&gt;overview of some of the terms you’ll see in the lessons&lt;/a&gt;.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An HTML file has two main parts, a &lt;em&gt;head&lt;/em&gt; and a &lt;em&gt;body&lt;/em&gt;. All the content that we want to show up on the page goes inside the body. We can also say these elements are &lt;em&gt;nested&lt;/em&gt; inside the body, or are &lt;em&gt;child elements&lt;/em&gt; of &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt;. The head contains extra information used by the web browser.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can manipulate the appearance of our HTML elements by writing CSS rules that change their properties. The browser assigns a certain value to some of those properties by default, and these defaults can sometimes be different from one web browser to another. Different types of element have different sets of properties available.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There’s also a way to alter our HTML elements from within the HTML file, and that’s by giving them &lt;em&gt;attributes&lt;/em&gt;—additional words inside the opening tag, like the &lt;code&gt;href&lt;/code&gt; in &lt;code&gt;&amp;lt;a href="https://example.com"&amp;gt;&lt;/code&gt;. But while CSS just changes the &lt;em&gt;appearance&lt;/em&gt;, attributes usually change the &lt;em&gt;behavior&lt;/em&gt; or &lt;em&gt;purpose&lt;/em&gt; of the element.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The way to create a group of elements that share the same CSS is to make a &lt;em&gt;class.&lt;/em&gt; It’s like having to wear a uniform (the same &lt;em&gt;styles&lt;/em&gt; as your classmates) to go to class!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One element can have multiple classes (write them separated by a space like &lt;code&gt;class="item blue round"&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The same class can be applied to many elements, and they don’t even all have to be the same type! E.g. I can assign the class &lt;code&gt;blue&lt;/code&gt; to both paragraphs and headings that I want to have &lt;code&gt;color: blue&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  HTML elements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;p&lt;/code&gt;, &lt;code&gt;h1&lt;/code&gt;, and &lt;code&gt;h2&lt;/code&gt; are tags for holding text. The &lt;code&gt;a&lt;/code&gt; tag turns text into a link. The &lt;code&gt;em&lt;/code&gt; and &lt;code&gt;strong&lt;/code&gt; tags mark a section of text as “emphasized” or “important”.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;main&lt;/code&gt;, &lt;code&gt;header&lt;/code&gt;, &lt;code&gt;footer&lt;/code&gt;, &lt;code&gt;section&lt;/code&gt;, and &lt;code&gt;article&lt;/code&gt; are &lt;em&gt;semantic tags&lt;/em&gt; that provide information about the page’s structure to a web browser or assistive technology. Like &lt;code&gt;div&lt;/code&gt;, they separate a page into different sections, but unlike &lt;code&gt;div&lt;/code&gt;, they indicate how that section fits into the larger structure of the page and what &lt;em&gt;purpose&lt;/em&gt; it serves.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;div&lt;/code&gt; element is often used to divide the page into areas with different style properties, such as making boxes with different background colors. A &lt;code&gt;div&lt;/code&gt; tag doesn’t have any &lt;em&gt;semantic meaning,&lt;/em&gt; so its main purpose is just for applying styles.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;img&lt;/code&gt; adds a picture, and this can go inside a &lt;code&gt;figure&lt;/code&gt; tag to associate it with a &lt;code&gt;figcaption&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ol&lt;/code&gt; or &lt;code&gt;ul&lt;/code&gt; creates a list, and each &lt;code&gt;li&lt;/code&gt; nested inside it is one list item.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;form&lt;/code&gt; creates a form where the user can send data back to the web server. Some elements you might put inside a form are &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;select&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt;, and &lt;code&gt;button&lt;/code&gt;. 

&lt;ul&gt;
&lt;li&gt;We also learned a &lt;em&gt;lot&lt;/em&gt; of different ways to use the &lt;code&gt;input&lt;/code&gt; tag inside forms. You can see an overview of these in the MDN articles “&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Forms/Basic_native_form_controls" rel="noopener noreferrer"&gt;Basic native form controls&lt;/a&gt;” and “&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types" rel="noopener noreferrer"&gt;HTML5 input types&lt;/a&gt;”.&lt;/li&gt;
&lt;li&gt;If you want me to write a separate post reviewing what we learned about forms, please let me know by leaving a comment here on dev.to, on the week 1 recap post in the freeCodeCamp forum, or mentioning me in the &lt;a href="https://discord.gg/pySW9YZfYY" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; server by typing &lt;code&gt;@vance&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Layout
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Elements get arranged differently on the page depending on whether their display type is &lt;em&gt;inline,&lt;/em&gt; &lt;em&gt;block&lt;/em&gt;, or &lt;em&gt;inline-block&lt;/em&gt;. Each type of tag defaults to a certain display type (e.g. the default for &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; is block), but we can use the CSS &lt;code&gt;display&lt;/code&gt; property to change it to something else.

&lt;ul&gt;
&lt;li&gt;Block elements take up the full width of their parent element (unless you change their &lt;code&gt;width&lt;/code&gt; property), even if their content is small, or if there’s no content at all. They always start on a new line, so a series of block elements will stack up on top of each other like stacking blocks. Or you could say they &lt;em&gt;block&lt;/em&gt; other elements from appearing inside their line.&lt;/li&gt;
&lt;li&gt;Inline elements can be &lt;em&gt;in the same line&lt;/em&gt; with other elements. They’re only as big as the content inside them.&lt;/li&gt;
&lt;li&gt;Inline-block elements will appear in the same line as other elements (just like inline ones), but instead of being tied to the size of their content, you can use the &lt;code&gt;width&lt;/code&gt; and &lt;code&gt;height&lt;/code&gt; properties to change their size.&lt;/li&gt;
&lt;li&gt;Why is this helpful? Let’s say you’re making a form and you want the &lt;code&gt;input&lt;/code&gt; elements to always be on a line by themselves, separate from their labels. You could accomplish this by setting the CSS rule &lt;code&gt;input {display: block;}&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;em&gt;Margin&lt;/em&gt; is the space around the &lt;em&gt;outside&lt;/em&gt; of an element, like the margins along the edges of a page in a book. &lt;em&gt;Padding&lt;/em&gt; is empty space &lt;em&gt;inside&lt;/em&gt; an element, between its border and its content. Padding is like wrapping your content in bubble wrap. Both of these properties have the same purpose, to create open space between the elements in your page. This helps with readability.

&lt;ul&gt;
&lt;li&gt;Beware that browsers often add some margin or padding by default! If your elements seem to be the wrong size, this might be why.&lt;/li&gt;
&lt;li&gt;If you’re having trouble working with margin and padding, don’t worry, we’re going to focus more on this on Tuesday!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Setting &lt;code&gt;margin: auto&lt;/code&gt; on a block element will center it.&lt;/li&gt;

&lt;li&gt;We can use the CSS properties &lt;code&gt;height&lt;/code&gt;, &lt;code&gt;width&lt;/code&gt;, and &lt;code&gt;max-width&lt;/code&gt; to set the size of an element.&lt;/li&gt;

&lt;li&gt;Widths can be given in &lt;em&gt;absolute units&lt;/em&gt; like pixels (e.g. &lt;code&gt;100px&lt;/code&gt;), which stay the same no matter what size everything else is, or &lt;em&gt;relative units&lt;/em&gt;, where the size depends on other factors. Percents like &lt;code&gt;50%&lt;/code&gt; are relative to the size of the parent element, &lt;code&gt;em&lt;/code&gt; and &lt;code&gt;rem&lt;/code&gt; depend on the text size, and then &lt;code&gt;vh&lt;/code&gt; and &lt;code&gt;vw&lt;/code&gt; depend on the size of the user’s browser window.&lt;/li&gt;

&lt;li&gt;Use &lt;code&gt;text-align&lt;/code&gt; to arrange the text within a block element, e.g. to center it.&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting artistic
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;font-size&lt;/code&gt; and &lt;code&gt;font-family&lt;/code&gt; to customize how text looks.&lt;/li&gt;
&lt;li&gt;Draw a border around an element with the &lt;code&gt;border&lt;/code&gt; property. It needs a thickness, style, and color: &lt;code&gt;border: 2px solid green;&lt;/code&gt; . Or use &lt;code&gt;border-left&lt;/code&gt;, &lt;code&gt;border-top&lt;/code&gt;, etc to make a border on just one side!&lt;/li&gt;
&lt;li&gt;Color in the “conceptual rectangles” of your elements with the &lt;code&gt;background&lt;/code&gt; or &lt;code&gt;background-color&lt;/code&gt; property. The difference is that &lt;code&gt;background-color&lt;/code&gt; only accepts a color as a value, while &lt;code&gt;background&lt;/code&gt; can accept either a color or an image, including a gradient generated by the &lt;code&gt;linear-gradient&lt;/code&gt; function.&lt;/li&gt;
&lt;li&gt;We have lots of ways to set colors for things like backgrounds, borders, and text! Here are 4 different ways to make some text purple:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;color: purple;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;color: #800080;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;color: rgb(128, 0, 128);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;color: hsl(300, 100%, 25.1%);&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;These color values can be modified to make them partly transparent. Add an extra two digits to the end of the hex code, like &lt;code&gt;#800080AA&lt;/code&gt;, or replace the &lt;code&gt;rgb&lt;/code&gt; and &lt;code&gt;hsl&lt;/code&gt; functions with &lt;code&gt;rgba&lt;/code&gt; and &lt;code&gt;hsla&lt;/code&gt;.&lt;/li&gt;

&lt;li&gt;Use the &lt;code&gt;opacity&lt;/code&gt; property to make an element transparent. Give it a decimal value between 0 and 1.0. This method makes all of the content inside the element transparent too, instead of just the background!&lt;/li&gt;

&lt;li&gt;You can create a gradient in any property that accepts an image, like &lt;code&gt;background&lt;/code&gt;! Here's an example:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;background: linear-gradient(90deg, rgb(255, 0, 0) 75%, rgb(0, 255, 0), rgb(0, 0, 255));&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;box-shadow&lt;/code&gt; creates the effect of a shadow under your element or an outline around it.&lt;/li&gt;

&lt;/ul&gt;




&lt;p&gt;Phew, that was a lot! But remember, you aren’t expected to memorize all these tags and properties. You just want to have a general idea of what options exist, and then you can always look up how to use them when you need them. I also want to reassure everybody that there won’t always be such a huge barrage of brand-new concepts every week—there was just a lot we had to cover in order to have the building blocks to let us get started. Next week, we’ll learn &lt;em&gt;some&lt;/em&gt; new topics, but we’ll also take some of this week’s topics and examine them in more detail instead. Plus, our next class on Monday is all about the first certification project! Get excited, because this is your chance to start flexing your creativity and building something that’s really your own, instead of just following instructions! (As a preview, &lt;a href="https://caesiumtea.gitlab.io/survey/" rel="noopener noreferrer"&gt;here’s the web page that I made for the first project&lt;/a&gt; when I took this bootcamp last year.)&lt;/p&gt;

&lt;p&gt;And if you feel confused or uncertain about anything, please don’t hesitate to ask questions! You can ask on the &lt;a href="https://discord.gg/pySW9YZfYY" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;, on the &lt;a href="https://forum.freecodecamp.org/c/2023-webdev-bootcamp/586" rel="noopener noreferrer"&gt;forum&lt;/a&gt;, or in the comments of this post. &lt;a href="https://developer.mozilla.org/" rel="noopener noreferrer"&gt;MDN&lt;/a&gt; is also a great place to look up any HTML elements or CSS properties that you don’t remember. And don’t forget your extra homework: please be gentle with yourself! Learning to code is &lt;em&gt;hard work&lt;/em&gt; and you deserve to rest as well. &lt;/p&gt;

&lt;p&gt;Keep up the great work, everybody! I know you can do it! 💪&lt;/p&gt;

&lt;p&gt;PS: If you want to learn more about active recall and study strategies, check out this &lt;a href="https://www.youtube.com/watch?v=ukLnPbIffxE" rel="noopener noreferrer"&gt;great video from Ali Abdaal&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quiz answers
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;HTML describes the structure and content of a web page. CSS describes the visual appearance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; (which you can also put inside a &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A self-closing tag doesn’t have a matching closing tag after the content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A block element occupies the entire width of its parent element. An inline element is only as big as its content and it fits &lt;em&gt;in line with&lt;/em&gt; other elements. Some properties, like &lt;code&gt;height&lt;/code&gt;, &lt;code&gt;width&lt;/code&gt;, and &lt;code&gt;background-color&lt;/code&gt;, don’t work on inline elements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;.large-text&lt;/code&gt; (Don’t forget the period (&lt;code&gt;.&lt;/code&gt;) at the beginning! That’s what makes this rule target a &lt;em&gt;class&lt;/em&gt; instead of looking for some imaginary tag called &lt;code&gt;&amp;lt;large-text&amp;gt;&lt;/code&gt;, which doesn’t exist.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Here is an example &lt;code&gt;head&lt;/code&gt; element:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"utf-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"viewport"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"width=device-width, initial-scale=1.0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Bad Website Club!&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"styles.css"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some ways to improve accessibility that we’ve talked about so far are to make sure all images have alt text, use semantic elements, attach labels to input fields, and use good color contrast.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;textarea&lt;/code&gt; is actually not an &lt;code&gt;input&lt;/code&gt; type, even though it’s often used in forms! It’s a separate type of tag, written like &lt;code&gt;&amp;lt;textarea&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/code&gt;. (This one trips me up alllll the time!)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cover art by &lt;a href="https://ecasticx.com/" rel="noopener noreferrer"&gt;Kiri&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>freecodecamp</category>
      <category>html</category>
      <category>css</category>
      <category>webdev</category>
    </item>
    <item>
      <title>BWC Bootcamp Recap: HTML and CSS vocabulary</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Thu, 03 Aug 2023 05:25:04 +0000</pubDate>
      <link>https://dev.to/caesiumtea/bwc-bootcamp-recap-html-and-css-vocabulary-41e4</link>
      <guid>https://dev.to/caesiumtea/bwc-bootcamp-recap-html-and-css-vocabulary-41e4</guid>
      <description>&lt;p&gt;Hello friends and learners! This is my first post as a teaching assistant for the &lt;a href="https://www.freecodecamp.org/news/free-webdev-bootcamp/" rel="noopener noreferrer"&gt;2023 Bad Website Club/freeCodeCamp Web Dev Bootcamp&lt;/a&gt;. I hope your learning is off to a great start! In the coming weeks, I'll be writing a series of recap posts to help us keep track of all these exciting new things we're learning. Today it's all about vocabulary!&lt;/p&gt;

&lt;p&gt;One of the struggles when you're brand new to learning web development is just remembering all of the words that people are using! It can be really frustrating when a tutorial tells you to add an attribute and you're like "wait, what even is an attribute?" My aim here is to define all of those new terms that we'll encounter in the &lt;a href="https://www.freecodecamp.org/learn/2022/responsive-web-design/" rel="noopener noreferrer"&gt;freeCodeCamp Responsive Web Design&lt;/a&gt; curriculum.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key terms
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML&lt;/strong&gt; is the most basic language of the web. &lt;em&gt;Every&lt;/em&gt; web page uses HTML! It provides the &lt;strong&gt;structure&lt;/strong&gt; and &lt;strong&gt;content&lt;/strong&gt; of the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CSS&lt;/strong&gt; describes the &lt;strong&gt;visual appearance&lt;/strong&gt;. This includes colors, fonts, sizes, and how things are laid out on the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accessibility&lt;/strong&gt; refers to how usable your website is for different types of people, particularly people with disabilities. We all have a duty to make our websites as accessible as possible, because the web is for everyone!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  HTML
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0ualnycrn6ovr90i0qt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj0ualnycrn6ovr90i0qt.png" alt="Diagram of an HTML element, labeling the tags and content" width="800" height="248"&gt;&lt;/a&gt;&lt;br&gt;
(Image from &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/HTML_basics" rel="noopener noreferrer"&gt;MDN: HTML basics&lt;/a&gt;, by Mozilla Contributors, licensed under &lt;a href="https://creativecommons.org/licenses/by-sa/2.5/" rel="noopener noreferrer"&gt;CC-BY-SA 2.5&lt;/a&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each “thing” in an HTML document (in other words, each thing in a web page) is called an &lt;strong&gt;element&lt;/strong&gt;. For example, this could be a picture, a link, or a chunk of text.&lt;/li&gt;
&lt;li&gt;Most elements start with an &lt;strong&gt;opening tag&lt;/strong&gt; and end with a &lt;strong&gt;closing tag&lt;/strong&gt;. However, there are some &lt;strong&gt;self-closing&lt;/strong&gt; tags (also known as &lt;strong&gt;void elements&lt;/strong&gt;), which don’t have a closing tag. *

&lt;ul&gt;
&lt;li&gt;How many self-closing tags can you name?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;A tag might have &lt;strong&gt;attributes&lt;/strong&gt; to determine its properties. An element can have many attributes, or none!
&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"large-text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;em&amp;gt;&lt;/span&gt;Bad Website Club&lt;span class="nt"&gt;&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This whole line is a &lt;strong&gt;p element&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;p class="large-text"&amp;gt;&lt;/code&gt; is the &lt;strong&gt;opening tag&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;/p&amp;gt;&lt;/code&gt; is the &lt;strong&gt;closing tag&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;class="large-text"&lt;/code&gt; is an &lt;strong&gt;attribute&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;class&lt;/code&gt; is the &lt;strong&gt;attribute name&lt;/strong&gt; and &lt;code&gt;large-text&lt;/code&gt; is the &lt;strong&gt;attribute value&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;em&lt;/code&gt; element is a &lt;strong&gt;child&lt;/strong&gt; of the &lt;code&gt;p&lt;/code&gt; element, because it’s placed inside. &lt;code&gt;p&lt;/code&gt; is the &lt;strong&gt;parent&lt;/strong&gt; element. We also say that the &lt;code&gt;em&lt;/code&gt; element is &lt;strong&gt;nested&lt;/strong&gt; inside the &lt;code&gt;p&lt;/code&gt; element, like a little baby bird sitting inside its parent’s nest!&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;descendants&lt;/strong&gt; of an element are &lt;em&gt;everything&lt;/em&gt; nested inside it: its child elements, but also its children's child elements, and its children's children's children, and so on. In the following example, &lt;code&gt;section&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; and &lt;code&gt;em&lt;/code&gt; are all descendants of &lt;code&gt;body&lt;/code&gt;, but only &lt;code&gt;section&lt;/code&gt; is a direct child of &lt;code&gt;body&lt;/code&gt;:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"large-text"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;em&amp;gt;&lt;/span&gt;Bad Website Club&lt;span class="nt"&gt;&amp;lt;/em&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;* Note: According to the &lt;a href="https://html.spec.whatwg.org/multipage/syntax.html#start-tags:void-elements" rel="noopener noreferrer"&gt;HTML specification&lt;/a&gt;, "self-closing tag" actually does not refer to void elements, and has a more specific technical meaning instead. However, you will still often see the term "self-closing tag" used to mean "opening tag which does not have a partner closing tag", including in the freeCodeCamp Responsive Web Design curriculum.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwo6hc8i744c57e856cv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwo6hc8i744c57e856cv7.png" alt="Diagram of a CSS rule, labeling the selector, declaration, and property." width="800" height="451"&gt;&lt;/a&gt;&lt;br&gt;
(Image from &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/CSS_basics" rel="noopener noreferrer"&gt;MDN: CSS basics&lt;/a&gt;, by Mozilla Contributors, licensed under &lt;a href="https://creativecommons.org/licenses/by-sa/2.5/" rel="noopener noreferrer"&gt;CC-BY-SA 2.5&lt;/a&gt;)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CSS is grouped into &lt;strong&gt;rules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;A rule starts with a &lt;strong&gt;selector&lt;/strong&gt;. This part determines &lt;em&gt;which elements&lt;/em&gt; the rule will apply to. &lt;/li&gt;
&lt;li&gt;Each line inside the curly braces is called a &lt;strong&gt;declaration&lt;/strong&gt;. This part says &lt;em&gt;how you want to change&lt;/em&gt; those elements. This word doesn't come up super often though.&lt;/li&gt;
&lt;li&gt;The part before the colon (&lt;code&gt;:&lt;/code&gt;) is the &lt;strong&gt;property&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The part after the colon is the property's &lt;strong&gt;value&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.large-text&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2em&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This whole code block is one CSS &lt;strong&gt;rule&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.large-text&lt;/code&gt; is the &lt;strong&gt;selector&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;font-size: 2em;&lt;/code&gt; is a &lt;strong&gt;declaration&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;font-size&lt;/code&gt; is the &lt;strong&gt;property&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;2em&lt;/code&gt; is the &lt;strong&gt;value&lt;/strong&gt; of &lt;code&gt;font-size&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When a CSS rule applies to certain elements, we say that it's &lt;strong&gt;targeting&lt;/strong&gt; those elements. This rule &lt;em&gt;targets the &lt;code&gt;large-text&lt;/code&gt; class&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Did I leave something out? Are there any other words you've heard while learning web development that you don't understand, or maybe ones that you mix up with each other or just keep forgetting? Feel free to mention them in a comment and we can sort it out together!&lt;/p&gt;

&lt;h3&gt;
  
  
  Acknowledgements
&lt;/h3&gt;

&lt;p&gt;Cover art by &lt;a href="https://ecasticx.com/" rel="noopener noreferrer"&gt;Kiri&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Thanks to &lt;a href="https://dev.to/alohci"&gt;Nicholas Stimpson&lt;/a&gt; for clearing up the definition of self-closing tags.&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Mini CSS trick: emoji page dividers with the content property</title>
      <dc:creator>vance</dc:creator>
      <pubDate>Sat, 18 Mar 2023 06:16:18 +0000</pubDate>
      <link>https://dev.to/caesiumtea/mini-css-trick-emoji-page-dividers-with-the-content-property-3k42</link>
      <guid>https://dev.to/caesiumtea/mini-css-trick-emoji-page-dividers-with-the-content-property-3k42</guid>
      <description>&lt;p&gt;Page divider graphics are a common way to break up blocks of text on a web page, creating negative space that helps a page feel less busy and can signal a change in topics. They're basically the fancier sibling of a horizontal rule, and often look like a curly swash or a few geometric shapes. In print books, they're often used to separate chapters or scenes.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F420p7pgo87vdxufbbffn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F420p7pgo87vdxufbbffn.jpg" alt="Several page dividers, which each have the vague silhouette of a horizontal line. Some are made of a series of swirly flourishes, and others are made of line segments broken up by dots or stars." width="800" height="560"&gt;&lt;/a&gt; &lt;br&gt;
&lt;em&gt;Dividers by &lt;a href="https://www.vecteezy.com/vector-art/86587-text-dividers-set-vectors" rel="noopener noreferrer"&gt;Vecteezy user onfocus onfocus&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I wanted to whip up a simple graphical page divider to put the finishing touches on my current project, but I didn't want to take time looking for images to use. Then it hit me that I could just use an emoji as a divider instead! My page is about red pandas (it's actually my tribute page for &lt;a href="https://www.freecodecamp.org/learn/2022/responsive-web-design/build-a-tribute-page-project/build-a-tribute-page" rel="noopener noreferrer"&gt;this freeCodeCamp project&lt;/a&gt;), which there isn't a specific emoji for (yet!), but the photos on the page do feature plenty of bamboo, so I picked this cute bamboo kadomatsu emoji: 🎍&lt;/p&gt;

&lt;h2&gt;
  
  
  Method
&lt;/h2&gt;

&lt;p&gt;Start making your divider by placing an empty paragraph in your HTML at whatever points you want to insert a divider, and make sure to give that paragraph a class, like &lt;code&gt;divider&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;..... &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"divider"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt; ... &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"divider"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt; ......
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I started out by actually pasting the emoji into the body of each paragraph, but then I realized there's a better way: the &lt;code&gt;content&lt;/code&gt; CSS property! &lt;/p&gt;

&lt;p&gt;If you're unfamiliar, &lt;code&gt;[content](https://developer.mozilla.org/en-US/docs/Web/CSS/content)&lt;/code&gt; can be used with the &lt;code&gt;::before&lt;/code&gt; and &lt;code&gt;::after&lt;/code&gt; pseudo-selectors to add extra content inside an HTML tag. It's great because it lets you apply the Don't Repeat Yourself principle to your HTML a little bit: if you want to change up the divider (say, to a different emoji), instead of manually editing each paragraph element in your HTML file, you can change it just once in the CSS rule.&lt;/p&gt;

&lt;p&gt;We'll use a &lt;code&gt;.divider::after&lt;/code&gt; selector to insert the emoji.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.divider&lt;/span&gt;&lt;span class="nd"&gt;::after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"🎍"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you should see the dividers on your page! But they're probably not doing a very good job of dividing anything, just sitting right on top of your content, at the beginning of the line. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstz9wdcf5e6ko12h15nl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstz9wdcf5e6ko12h15nl.png" alt="Screenshot of a web page featuring two places where the bamboo emoji is on a line by itself and left aligned, one above and one below a block of text titled Sources." width="668" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's style &lt;code&gt;.divider&lt;/code&gt; to make them more useful. Dividers are typically centered on the page, so we'll use &lt;code&gt;text-align&lt;/code&gt; and &lt;code&gt;margin: auto&lt;/code&gt;. Also, a divider's purpose is to create space, so let's add some top and bottom margin.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.divider&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-top&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;margin-bottom&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;center&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkm3dt8tqdabfxxzo2z1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flkm3dt8tqdabfxxzo2z1.png" alt="A screenshot almost identical to the last one, but now the emoji are centered on the page and surrounded by empty lines above and below." width="672" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that's it! The dividers should be nicely behaved now and creating plenty of negative space on your page. &lt;/p&gt;

&lt;h2&gt;
  
  
  Warnings
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/content#syntax" rel="noopener noreferrer"&gt;MDN notes&lt;/a&gt; that you should always use the Unicode escape sequence for non-Latin characters, though in my testing, just pasting the emoji itself into the CSS worked fine for my browser. &lt;/p&gt;

&lt;p&gt;But if you want to play it safe, you can find the escape sequences by looking up your emoji on &lt;a href="https://emojipedia.org/" rel="noopener noreferrer"&gt;Emojipedia&lt;/a&gt;. Look for the emoji's &lt;em&gt;codepoint&lt;/em&gt;--you can find it in the right-hand column on this &lt;a href="https://emojipedia.org/emoji/" rel="noopener noreferrer"&gt;overview page&lt;/a&gt;, or if you're on the page for an individual emoji, scroll down below all the example images to find the Codepoint heading. The codepoint should look something like &lt;code&gt;U+1F38D&lt;/code&gt;. Copy just the hexadecimal value after the plus sign, and prefix it with a backslash to make the escape sequence, e.g. &lt;code&gt;\1F38D&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.divider&lt;/span&gt;&lt;span class="nd"&gt;::after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;"\1f38d"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c"&gt;/*🎍*/&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;(I included a comment with the actual emoji character so that I'll remember what the escape sequence refers to when I'm looking at the code without a preview later.)&lt;/p&gt;

&lt;p&gt;When you design with emoji, it's also important to keep in mind that they'll appear differently on every device, and even the colors might be completely different from one system to another. So I don't recommend using this idea on pages that have a very strict color scheme.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;It's super easy to change up the emoji since we used &lt;code&gt;content&lt;/code&gt;, so why not play around with a few different designs? You can use more than a single emoji, too--try repeating the same emoji with spaces in between, or making a pattern of different emoji. If you do combine multiple emoji, keeping the pattern symmetrical will help maintain a tidy look that's more in line with traditional page dividers, but breaking the rules is fun too!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🎵   🎵   🎵
📕   📘   📗   📙
✨🔻🏳️‍⚧️🔻✨
🧦👗🩳👚🧣👖🧥👟
🌒🌓🌔🌕🌖🌗🌘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I went with an emoji that was related to my content, but there are also plenty of basic shape emoji that would work very nicely as generic dividers for any page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;➖🔆➖
◼   ⚜   ◼  
🔺🔻🔺🔻🔺
🔸 🔷 🔸 💠 🔸 🔷 🔸 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can even apply this method to other types of decorative "text" beyond emoji. How about a &lt;a href="https://kaomojihub.com/" rel="noopener noreferrer"&gt;kaomoji&lt;/a&gt; divider? Or a single ampersand in a fancy font? There are plenty of &lt;a href="https://www.fontspace.com/category/symbols,flourish" rel="noopener noreferrer"&gt;symbol or swash fonts&lt;/a&gt; out there to try, too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope you enjoy using this little trick to quickly add some visual interest to your web pages! I'd love to see your emoji divider designs or how you use it in your projects.&lt;/p&gt;

&lt;p&gt;This is my first dev.to post, so I would be very grateful for any feedback you have on it! Please let me know if anything is unclear, and feel free to ask any questions to might have.&lt;/p&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
