0

Probably stupid question but I'm scratching my head with this.

Why does this work?

<html>
<head>
<body>
<div class="tbs_pagelist_image" style="background-image:url('http://indivisiblemusic.com/userdata/site/tbs_header.jpg');background-repeat:no-repeat;background-size:cover;width: 150px;height: 150px;"></div>
</body>
</html>

But this does NOT work?

<html>
<head>
<style>
.image (
width: 100px;
height: 100px;
)
</style>
<body>
<div class="image" style="background-image:url('http://indivisiblemusic.com/userdata/site/tbs_header.jpg');background-repeat:no-repeat;background-size:cover;"></div>
</body>
</html>

I am confused... Thanks so much for helping me out clearing my confusion

marcnyc
  • 585
  • 1
  • 4
  • 17
  • Fix the syntax error in the css: http://jsfiddle.net/wwnEw/ – karthikr Jun 29 '14 at 00:14
  • Use {} not (). Get yourself a text editor, such as Textmate or notepad++, that has syntax highlighting. It will save you the headache of these simple mistakes holding you up. – bennett_an Jun 29 '14 at 01:06

1 Answers1

1

You are using ( ), that is not the correct syntax; you should be using:

.image {
width: 100px;
height: 100px;
}

http://jsfiddle.net/6mfg5/

adaam
  • 3,700
  • 7
  • 27
  • 51