HighDots Forums  

Indenting and floats

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Indenting and floats in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
David Trimboli
 
Posts: n/a

Default Indenting and floats - 07-16-2009 , 10:06 PM






I don't think there's a way to do this without changing the HTML, but I
thought I'd ask.

I've got documents with screen shots set up like this:

<p><img src="yadda" alt="yaddayadda" class="screenshot">Text here</p>

Now, I like to indent paragraphs, but not the ones after headings, and I
don't want to indent the ones with screen shots. The heading bit is easy
(h1 + p, etc.), but is there a way I could select "any P that contains
an IMG with class=screenshot"?

Yeah, I could do this by surrounding the whole thing in a DIV and
putting the IMG outside the P, but I was curious if there was a way to
do it without that.

--
David Trimboli
http://www.trimboli.name/

Reply With Quote
  #2  
Old   
dorayme
 
Posts: n/a

Default Re: Indenting and floats - 07-16-2009 , 11:08 PM






In article <4a5fdc95$0$31280$607ed4bc (AT) cv (DOT) net>,
David Trimboli <david (AT) trimboli (DOT) name> wrote:

Quote:
I don't think there's a way to do this without changing the HTML, but I
thought I'd ask.

I've got documents with screen shots set up like this:

p><img src="yadda" alt="yaddayadda" class="screenshot">Text here</p

Now, I like to indent paragraphs, but not the ones after headings, and I
don't want to indent the ones with screen shots. The heading bit is easy
(h1 + p, etc.), but is there a way I could select "any P that contains
an IMG with class=screenshot"?

Yeah, I could do this by surrounding the whole thing in a DIV and
putting the IMG outside the P, but I was curious if there was a way to
do it without that.
You could also do it by classing the Ps that have the screenshots. If
you did this, you would not need another wrapper like a DIV, nor special
CSS for Ps after headings, you just apply no indent to the class. What
is more, you also save on not needing to class the screenshot image
because you can target it via

..classNameForSpecialPs img {...}

--
dorayme

Reply With Quote
  #3  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Indenting and floats - 07-17-2009 , 05:20 PM



Gazing into my crystal ball I observed David Trimboli
<david (AT) trimboli (DOT) name> writing in news:4a5fdc95$0$31280$607ed4bc (AT) cv (DOT) net:

Quote:
I don't think there's a way to do this without changing the HTML, but I
thought I'd ask.

I've got documents with screen shots set up like this:

p><img src="yadda" alt="yaddayadda" class="screenshot">Text here</p

Now, I like to indent paragraphs, but not the ones after headings, and
I
don't want to indent the ones with screen shots. The heading bit is
easy
(h1 + p, etc.), but is there a way I could select "any P that contains
an IMG with class=screenshot"?
p img.screenshot {/* do your stuff */}


--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #4  
Old   
jeff
 
Posts: n/a

Default Re: Indenting and floats - 07-17-2009 , 06:16 PM



Adrienne Boswell wrote:
Quote:
Gazing into my crystal ball I observed David Trimboli
david (AT) trimboli (DOT) name> writing in news:4a5fdc95$0$31280$607ed4bc (AT) cv (DOT) net:

I don't think there's a way to do this without changing the HTML, but I
thought I'd ask.

I've got documents with screen shots set up like this:

p><img src="yadda" alt="yaddayadda" class="screenshot">Text here</p

Now, I like to indent paragraphs, but not the ones after headings, and
I
don't want to indent the ones with screen shots. The heading bit is
easy
(h1 + p, etc.), but is there a way I could select "any P that contains
an IMG with class=screenshot"?

p img.screenshot {/* do your stuff */}
Aren't you styling the image here, and not the paragraph? I think the
OP wanted the reverse.

Jeff
Quote:

Reply With Quote
  #5  
Old   
Adrienne Boswell
 
Posts: n/a

Default Re: Indenting and floats - 07-18-2009 , 12:08 AM



Gazing into my crystal ball I observed jeff <jeff_thies (AT) att (DOT) net> writing
in news:h3qt7u$o00$1 (AT) news (DOT) albasani.net:

Quote:
Adrienne Boswell wrote:
Gazing into my crystal ball I observed David Trimboli
david (AT) trimboli (DOT) name> writing in
news:4a5fdc95$0$31280$607ed4bc (AT) cv (DOT) net:

I don't think there's a way to do this without changing the HTML,
but I thought I'd ask.

I've got documents with screen shots set up like this:

p><img src="yadda" alt="yaddayadda" class="screenshot">Text
here</p

Now, I like to indent paragraphs, but not the ones after headings,
and
I
don't want to indent the ones with screen shots. The heading bit is
easy
(h1 + p, etc.), but is there a way I could select "any P that
contains an IMG with class=screenshot"?

p img.screenshot {/* do your stuff */}

Aren't you styling the image here, and not the paragraph? I think
the
OP wanted the reverse.

Jeff



You're right. That's what you get for going on to Usenet when you're in
the process of moving.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #6  
Old   
jeff
 
Posts: n/a

Default Re: Indenting and floats - 07-18-2009 , 07:19 AM



Adrienne Boswell wrote:
Quote:
Gazing into my crystal ball I observed jeff <jeff_thies (AT) att (DOT) net> writing
in news:h3qt7u$o00$1 (AT) news (DOT) albasani.net:

Adrienne Boswell wrote:
Gazing into my crystal ball I observed David Trimboli
david (AT) trimboli (DOT) name> writing in
news:4a5fdc95$0$31280$607ed4bc (AT) cv (DOT) net:

I don't think there's a way to do this without changing the HTML,
but I thought I'd ask.

I've got documents with screen shots set up like this:

p><img src="yadda" alt="yaddayadda" class="screenshot">Text
here</p

Now, I like to indent paragraphs, but not the ones after headings,
and
I
don't want to indent the ones with screen shots. The heading bit is
easy
(h1 + p, etc.), but is there a way I could select "any P that
contains an IMG with class=screenshot"?
p img.screenshot {/* do your stuff */}
Aren't you styling the image here, and not the paragraph? I think
the
OP wanted the reverse.

Jeff


You're right. That's what you get for going on to Usenet when you're in
the process of moving.

Good luck with your move. I know I wouldn't want to move!

Jeff

Reply With Quote
Reply




Thread Tools
Display Modes

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

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.