WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > WEB DESIGN > CSS > I must be crazy. Div not working for no apparent reason.

Reply
  Thread Tools Display Modes
Old 24th May 14, 03:01 AM   #1
Rylandish
WLC Member
 
Join Date: May 2014
Posts: 1
Default I must be crazy. Div not working for no apparent reason.

This is my HTML:

Code:
<div class="RYYY"><img src="http://bla.com/image.jpg" /></div>
This is my CSS:

Code:
.RYYY { 
   width: 100px;
}
I know this looks stupidly simple, I was doing something more complex (placing text over an image inside of a table), but when nothing worked I broke it down to this. Just this. Not inside of anything else, just this. I thought maybe somehow the name was conflicting with something else and changed it to this absolutely silly one. No difference. There are no unclosed brackets, missing semicolons, missing colons, spelling errors, etc. anywhere in the CSS document. Everything else in the CSS document works perfectly, all over the site. But my one little div does nothing.

I also tried div.RYYY and tried making it an id #, I even tried the hacky "!important". Nothing works.

The image still displays bigger than the whole damn screen.

Maybe you can help, or at least you can laugh at my completely flabbergasted misery.
Rylandish is offline   Reply With Quote
Old 24th May 14, 03:48 AM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,711
Default Re: I must be crazy. Div not working for no apparent reason.

You're changing the DIV size, not the image size.

Code:
.RYYY img {width:100px;}

/* OR */
.RYYY {width:100px;}
.RYYY img {width:100%;}
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Old 25th May 14, 12:56 PM   #3
Phreaddee
WLC Lover
 
Phreaddee's Avatar
 
Join Date: Oct 2010
Location: Newcastle, NSW, Australia
Posts: 768
Default Re: I must be crazy. Div not working for no apparent reason.

I'd run with
.RYYY img {width:100%;}
Phreaddee is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:13 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.