Closed (fixed)
Project:
Block Class
Version:
5.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2009 at 17:48 UTC
Updated:
24 Jan 2009 at 09:15 UTC
Hello, I'm pretty new to CSS and I'm wondering if there's a way to define a CSS for only part of the contents of the block. i.e. I'd like to center an image but not the text of the block. I've used Block Class to center the content and not the title of the block so far, but I'd like to somehow distinguish between the text and the image. Is this possible?
Thanks for the help!
Comments
Comment #1
todd nienkerk commentedXoso: Your question doesn't really relate to the Block Class module, but since I understand how complicated CSS can be, I'll try to send you in the right direction.
Anything that stands alone or is followed by a period or hash mark is an "element" (
div,img, etc.). Anything preceded by a period is a "class" (.blockabove).To select an element within an element, you simply put them all together in a line:
This means "any image within a div should have a margin of 10 pixels."
To select an element within a particular class of block, add a
.classto the outer element:This means "any image within a div of class 'foo' should have a margin of 10 pixels."
To select particular elements within a block -- blocks usually have class "block" assigned to one of their outer divs -- you'd do something like this:
I hope this gets you on the right track. Please refer to the many basic CSS guides found online for for help.
Comment #2
millions commentedThanks for taking the time to give me some pointers, I appreciate it!