Attributes in CSS

Updated: February 17, 2022
No Credit Card Required


Welcome Back 

Lets start styling with CSS. In coding HTML, you learned how to give some of your tag’s extra information, also known as attributes.  You used the Href attribute to tell anchors where to send the user. You use the source attribute to find an image for the image tag to display. 

Some attributes can be used on pretty much all of the tags. One of these attributes is called “style.” Style changes the way a tag looks when it's rendered.  This is how I changed the color of my headings from black to green. Not to mention how I styled a whole bunch of other things too. 

Style takes CSS code as a value. Every style starts with a property like color, followed by a colon, and a value.  In this case, the specific color you want to use. You can use keywords like blue, green, and yellow to change the color of your text.

There are the famous colors: blue, green, yellow, red, orange, black, etc.  Then there are some less famous colors,. But remember that a computer can render over 4 million colors, so you can’t possible have names for those. For those you need to use a code. 

Now lets right click the keyword and select Quick Edit. There's our color picker. This allows you to change the way a color looks like how light or dark it is. You can even change the color completely and pick a red instead.  As you make changes, it produces a code for whatever color you pick. This gives you way more color options and keywords. 

Although it's harder to tell what the color is because it's written in code rather than plain English like keywords are. Feel free to use both color codes and keywords to sell your page. 

Just make sure your page looks nice and your code is easy to read.

Ok. You got this! Lets move on to stylin Fonts and Text in the next lesson.

See you there.