From the course: Emmet: Fast and Efficient Web Coding

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding attributes

Adding attributes

From the course: Emmet: Fast and Efficient Web Coding

Start my 1-month free trial

Adding attributes

- [Instructor] As you probably know, HTML attributes are special words used inside an opening tag to control the elements behavior. Often you will need to add attributes to elements. You can easily do that with Emmet. When creating things like links or image tags, the custom attribute abbreviation of attribute equals value can be used. Let's say you want to produce an image that is a link. This can be done with Emmet in the following way. We could just write a greater than img. And when we expand out, we'll get an a tag with a href attribute and the image tag with both the source and alt attributes. As you can see, none of the values have been assigned. So we would need to go ahead and fill those in once we've expanded the code snippet. Many times you are going to know what those values are ahead of time. You can go ahead and take advantage of that by filling them out initially. I'm going to undo and we're going to…

Contents