Jump to content

Archived

This topic is now archived and is closed to further replies.

Ninjakreborn

css short hand(not working)

Recommended Posts

I finally started tryign to get into shorthand and have a bad experience with it first thing.
I tried turning this
[code]h1 {
font-size:1.5em;
background-color:#f2faf5;
color:#000000;
}

h2 {
color:#000000;
font-size:1.3em;
background-color:#f2faf5;
}

h3 {
color:#000000;
font-size:1.2em;
background-color:#f2faf5;
}

h4 {
color:#000000;
background-color:#f2faf5;
font-size:1.1em;

}

h5 {
color:#000000;
background-color:#f2faf5;
font-size:1em;

}

h6 {
color:#000000;
background-color:#f2faf5;
font-size:0.8em;
}
[/code]
into
[code]h1 h2 h3 h4 h5 h6 {
color: #000000;
background-color: #f2faf5;
}[/code]
The problem nwo though is, with the long drawn out style's it put's a background color with all of them, with this it doesn't put a background color with any of them.

Share this post


Link to post
Share on other sites
You have to have commas separating your tags in your selector if you are wanting to select [i]separate[/i] tags:
[code]
h1, h2, h3, h4, h5, h6 {
  color: #000000;
  background-color: #f2faf5;
}
[/code]

Share this post


Link to post
Share on other sites
I don't.  I was just learning shorthand.  I have been reading a few more book's on css to try and get better and better and it's helping even more.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.