4 Replies - 580 Views - Last Post: 16 February 2013 - 04:10 PM

#1 wadori  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 63
  • Joined: 30-October 09

One CSS class not taking

Posted 13 February 2013 - 11:06 PM

I have the following very simple page:
<html>

<head>
<style>
.floatright {float: right }
.setwide {width: 300; }
.sethigh {height: 300'; }
.floatset {float: right; width: 300; }
</style>
</head>

<body>
<img src="pics/snowcritter.jpg" class="floatset" />
<img src="pics/snowcritter.jpg" class='setwide' />
</body>

</html>



The problem is that all of the first three classes work just fine if I format the pictures using them, but for some reason the last one, floatset, just doesn't work. It is written in the same format as the others. You can see the output at www.wardricker.com/temp.html. floatset neither floats to the right nor sets to 300 px. Does anyone know why my page just doesn't accept floatset?

Is This A Good Question/Topic? 0
  • +

Replies To: One CSS class not taking

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: One CSS class not taking

Posted 13 February 2013 - 11:15 PM

a look at the Error Console should reveal something. first you’re missing the widths’ units, but on line #7 there is a ' causing ruckus.
Was This Post Helpful? 2
  • +
  • -

#3 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: One CSS class not taking

Posted 13 February 2013 - 11:21 PM

I believe it is to do with an extra ' in line 7.

regards,
Raghav

Edit: Sorry...didn't notice Dormilich's answer as I had not refreshed the page.

This post has been edited by raghav.naganathan: 13 February 2013 - 11:23 PM

Was This Post Helpful? 0
  • +
  • -

#4 wadori  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 63
  • Joined: 30-October 09

Re: One CSS class not taking

Posted 14 February 2013 - 09:32 AM

Yes, the ' was the problem. (How did that happen?!??) It's amazing that I didn't see that. I stared and stared at the fourth class description. I guess I didn't stare very hard a the third one, huh? Thanks.
Was This Post Helpful? 0
  • +
  • -

#5 souloHo3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-January 13

Re: One CSS class not taking

Posted 16 February 2013 - 04:10 PM

Just remember when coding to always be careful, simple mistakes like that happen all the time. Always double check your work and if you're still strungup w3c of course has both their CSS and HTML online validators which will quickly point out any syntax errors!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1